[Rt-commit] rt branch, 4.0/test-logout-refresh, created. rt-4.0.0rc7-150-g5c2b8bb

Thomas Sibley trs at bestpractical.com
Mon Apr 11 13:33:26 EDT 2011


The branch, 4.0/test-logout-refresh has been created
        at  5c2b8bb05947a6645b01acc18d671c7118bb25c9 (commit)

- Log -----------------------------------------------------------------
commit 2bdd600da8111bb587300ee8e68acd306eb28955
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Apr 8 10:47:14 2011 -0400

    Test that the meta-refresh on logout is set correctly

diff --git a/t/web/logout.t b/t/web/logout.t
new file mode 100644
index 0000000..eb22dde
--- /dev/null
+++ b/t/web/logout.t
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use RT::Test tests => 7;
+
+my ($baseurl, $agent) = RT::Test->started_ok;
+
+my $url = $agent->rt_base_url;
+diag $url if $ENV{TEST_VERBOSE};
+
+# test that logout would actually redirects to the correct URL
+{
+    ok $agent->login, "logged in";
+    $agent->follow_link_ok({ text => 'Logout' });
+    like $agent->uri, qr'/Logout\.html$', "right url";
+    $agent->content_contains('<meta http-equiv="refresh" content="1;URL=/"', "found the expected meta-refresh");
+}
+
+1;

commit 5c2b8bb05947a6645b01acc18d671c7118bb25c9
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Apr 11 12:08:30 2011 -0400

    Test that our callback for modifying the logout refresh works
    
    This callback is useful when using external web auth systems.  You want
    clear the user's RT session but also then direct them to the web auth
    logout page.
    
    This is the first callback test we have in RT, I believe.

diff --git a/t/web/html/Callbacks/logout.t/NoAuth/Logout.html/Default b/t/web/html/Callbacks/logout.t/NoAuth/Logout.html/Default
new file mode 100644
index 0000000..90278ae
--- /dev/null
+++ b/t/web/html/Callbacks/logout.t/NoAuth/Logout.html/Default
@@ -0,0 +1,6 @@
+<%args>
+$URL
+</%args>
+<%init>
+$$URL = 'http://bestpractical.com/rt';
+</%init>
diff --git a/t/web/logout.t b/t/web/logout.t
index eb22dde..dd44d02 100644
--- a/t/web/logout.t
+++ b/t/web/logout.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 7;
+use RT::Test tests => 12;
 
 my ($baseurl, $agent) = RT::Test->started_ok;
 
@@ -17,4 +17,23 @@ diag $url if $ENV{TEST_VERBOSE};
     $agent->content_contains('<meta http-equiv="refresh" content="1;URL=/"', "found the expected meta-refresh");
 }
 
+# Stop server and set MasonLocalComponentRoot
+RT::Test->stop_server;
+
+$RT::MasonLocalComponentRoot = RT::Test::get_abs_relocatable_dir('html');
+
+($baseurl, $agent) = RT::Test->started_ok;
+
+$url = $agent->rt_base_url;
+diag $url if $ENV{TEST_VERBOSE};
+
+# test that logout would actually redirects to URL from the callback
+{
+    ok $agent->login, "logged in";
+    $agent->follow_link_ok({ text => 'Logout' });
+    like $agent->uri, qr'/Logout\.html$', "right url";
+    $agent->content_contains('<meta http-equiv="refresh" content="1;URL=http://bestpractical.com/rt"', "found the expected meta-refresh");
+}
+
+
 1;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list