Index: openacs-4/packages/acs-authentication/tcl/test/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/test/authentication-procs.tcl,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-authentication/tcl/test/authentication-procs.tcl 6 Oct 2021 09:48:37 -0000 1.1.2.8 +++ openacs-4/packages/acs-authentication/tcl/test/authentication-procs.tcl 6 Oct 2021 11:47:42 -0000 1.1.2.9 @@ -380,6 +380,42 @@ } } +aa_register_case \ + -cats {api} \ + -procs { + auth::refresh_login + } \ + auth__refresh_login { + Test auth::refresh_login + } { + try { + set endpoint_name test__auth__refresh_login + ns_register_proc GET $endpoint_name { + set auth_level [ns_queryget auth_level] + if {$auth_level ne ""} { + ad_conn -set auth_level $auth_level + } + ns_return 200 text/plain [auth::refresh_login] + } + + set result [acs::test::user::create] + set user_id [dict get $result user_id] + + set d [acs::test::http -user_id $user_id \ + -method GET /$endpoint_name] + acs::test::reply_has_status_code $d 200 + aa_equals "Response must be the supplied user_id '$user_id'" \ + [dict get $d body] $user_id + + set d [acs::test::http -user_id $user_id \ + -method GET /$endpoint_name?auth_level=expired] + acs::test::reply_has_status_code $d 302 + + } finally { + ns_unregister_op GET $endpoint_name + } + } + # Local variables: # mode: tcl # tcl-indent-level: 4