File: logout.t

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,216 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,412; makefile: 487; python: 37; php: 15
file content (40 lines) | stat: -rw-r--r-- 1,166 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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->max_redirect(0);
    $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->max_redirect(0);
    $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;