X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_engine_response_redirect.t;h=38121205f9cfa9c454400dad76bae1af121304b8;hb=26dd6d9f6575fe782e78d6845fff3447e5ba5744;hp=5afe11fc9d48dd48159ca7959038b77a42652523;hpb=f98b9376ac4d6f02adb512be0608622452a39c48;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_engine_response_redirect.t b/t/live_engine_response_redirect.t index 5afe11f..3812120 100644 --- a/t/live_engine_response_redirect.t +++ b/t/live_engine_response_redirect.t @@ -6,21 +6,23 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 20; +use Test::More tests => 26; use Catalyst::Test 'TestApp'; { ok( my $response = request('http://localhost/engine/response/redirect/one'), 'Request' ); ok( $response->is_redirect, 'Response Redirection 3xx' ); - is( $response->code, 301, 'Response Code' ); + is( $response->code, 302, 'Response Code' ); is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/one', 'Test Action' ); is( $response->header('Location'), '/test/writing/is/boring', 'Response Header Location' ); + ok( $response->header('Content-Length'), '302 Redirect contains Content-Length' ); + ok( $response->content, '302 Redirect contains a response body' ); } { ok( my $response = request('http://localhost/engine/response/redirect/two'), 'Request' ); ok( $response->is_redirect, 'Response Redirection 3xx' ); - is( $response->code, 301, 'Response Code' ); + is( $response->code, 302, 'Response Code' ); is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/two', 'Test Action' ); is( $response->header('Location'), 'http://www.google.com/', 'Response Header Location' ); } @@ -31,6 +33,8 @@ use Catalyst::Test 'TestApp'; is( $response->code, 301, 'Response Code' ); is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/three', 'Test Action' ); is( $response->header('Location'), 'http://www.google.com/', 'Response Header Location' ); + ok( $response->header('Content-Length'), '301 Redirect contains Content-Length' ); + ok( $response->content, '301 Redirect contains a response body' ); } { @@ -39,4 +43,6 @@ use Catalyst::Test 'TestApp'; is( $response->code, 307, 'Response Code' ); is( $response->header('X-Catalyst-Action'), 'engine/response/redirect/four', 'Test Action' ); is( $response->header('Location'), 'http://www.google.com/', 'Response Header Location' ); + ok( $response->header('Content-Length'), '307 Redirect contains Content-Length' ); + ok( $response->content, '307 Redirect contains a response body' ); }