diff options
author | sunnavy <sunnavy@bestpractical.com> | 2022-05-03 20:17:55 +0300 |
---|---|---|
committer | sunnavy <sunnavy@bestpractical.com> | 2022-05-03 20:47:50 +0300 |
commit | 5e4c44412546ab8f4dcdffa9377974ce9c00e058 (patch) | |
tree | 3759d37e5e237c896073208072df41e9954f417e | |
parent | 819d7127681f44da2618f85d5be3fce85f69680e (diff) |
Make sure to not redirect for logout direct response tests4.4/test-logout-direct-response
LWP auto redirects on meta-refresh since 6.63, of which behavior we need
to get around in tests.
-rw-r--r-- | t/web/login.t | 3 | ||||
-rw-r--r-- | t/web/logout.t | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/t/web/login.t b/t/web/login.t index 862782a0cc..0292b3ae35 100644 --- a/t/web/login.t +++ b/t/web/login.t @@ -41,8 +41,11 @@ diag "normal login"; $m->title_is( 'RT at a glance', 'logged in' ); + my $max_redirect = $m->max_redirect; + $m->max_redirect(0); $m->follow_link_ok( { text => 'Logout' }, 'follow logout' ); $m->title_is( 'Logout', 'logout' ); + $m->max_redirect($max_redirect); } diag "tangent login"; diff --git a/t/web/logout.t b/t/web/logout.t index 73ff25c33d..34bfabb9f7 100644 --- a/t/web/logout.t +++ b/t/web/logout.t @@ -11,6 +11,7 @@ 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"); @@ -29,6 +30,7 @@ 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"); |