fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / web / logout.t
1 use strict;
2 use warnings;
3
4 use RT::Test tests => 12;
5
6 my ($baseurl, $agent) = RT::Test->started_ok;
7
8 my $url = $agent->rt_base_url;
9 diag $url if $ENV{TEST_VERBOSE};
10
11 # test that logout would actually redirects to the correct URL
12 {
13     ok $agent->login, "logged in";
14     $agent->follow_link_ok({ text => 'Logout' });
15     like $agent->uri, qr'/Logout\.html$', "right url";
16     $agent->content_contains('<meta http-equiv="refresh" content="1;URL=/"', "found the expected meta-refresh");
17 }
18
19 # Stop server and set MasonLocalComponentRoot
20 RT::Test->stop_server;
21
22 RT->Config->Set(MasonLocalComponentRoot => RT::Test::get_abs_relocatable_dir('html'));
23
24 ($baseurl, $agent) = RT::Test->started_ok;
25
26 $url = $agent->rt_base_url;
27 diag $url if $ENV{TEST_VERBOSE};
28
29 # test that logout would actually redirects to URL from the callback
30 {
31     ok $agent->login, "logged in";
32     $agent->follow_link_ok({ text => 'Logout' });
33     like $agent->uri, qr'/Logout\.html$', "right url";
34     $agent->content_contains('<meta http-equiv="refresh" content="1;URL=http://bestpractical.com/rt"', "found the expected meta-refresh");
35 }
36
37
38 1;