Add tests for body on redirects
Andy Grundman [Sat, 24 Feb 2007 05:34:24 +0000 (05:34 +0000)]
t/live_engine_response_redirect.t

index 3295779..3812120 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 use FindBin;
 use lib "$FindBin::Bin/lib";
 
-use Test::More tests => 20;
+use Test::More tests => 26;
 use Catalyst::Test 'TestApp';
 
 {
@@ -15,6 +15,8 @@ use Catalyst::Test 'TestApp';
     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' );
 }
 
 {
@@ -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' );
 }