summaryrefslogtreecommitdiff
path: root/rt/t/web/logout.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
commitf3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7 (patch)
treee5e9a077260613e6117d4697dd2985abd9b03d34 /rt/t/web/logout.t
parentcf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (diff)
parentcd3eb95ed1f3dc3e04cfc2b3b405f75b3ab086da (diff)
merging RT 4.0.6
Diffstat (limited to 'rt/t/web/logout.t')
-rw-r--r--rt/t/web/logout.t39
1 files changed, 39 insertions, 0 deletions
diff --git a/rt/t/web/logout.t b/rt/t/web/logout.t
new file mode 100644
index 000000000..889e5fc18
--- /dev/null
+++ b/rt/t/web/logout.t
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use RT::Test tests => 12;
+
+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");
+}
+
+# Stop server and set MasonLocalComponentRoot
+RT::Test->stop_server;
+
+RT->Config->Set(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;