Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Retain response object ($m->res) when creating subrequests via $m->go…

… and $m->visit
  • Loading branch information...
commit 06b8987a797bfc4e753436b0c2743f5cf12c08fb 1 parent 33ec3ab
@jonswar authored
Showing with 23 additions and 2 deletions.
  1. +23 −2 lib/Poet/t/PSGIHandler.pm
View
25 lib/Poet/t/PSGIHandler.pm
@@ -148,7 +148,28 @@ will also not be printed
expect_code => 302,
expect_headers => { Location => 'http://www.google.com/' },
);
- return;
+ $self->try_psgi_comp(
+ path => '/go_to_redirect.mc',
+ src => '
+<%init>
+$m->go("/redirect");
+</%init>
+',
+ expect_content => ' ',
+ expect_code => 302,
+ expect_headers => { Location => 'http://www.google.com/' },
+ );
+ $self->try_psgi_comp(
+ path => '/visit_redirect.mc',
+ src => '
+<%init>
+$m->visit("/redirect");
+</%init>
+',
+ expect_content => ' ',
+ expect_code => 302,
+ expect_headers => { Location => 'http://www.google.com/' },
+ );
$self->try_psgi_comp(
path => '/redirect_301.mc',
src => '
@@ -165,7 +186,7 @@ will not be printed
will not be printed
% $m->clear_and_abort(404);
',
- expect_content => ' ',
+ expect_content => qr/Not found/,
expect_code => 404,
);
}
Please sign in to comment.
Something went wrong with that request. Please try again.