X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_request_body.t;h=879ef14ac2cc73531bd9296f68dc47691bfa0c35;hp=40d7ab294cc1b8117aa4d6fa099f8847ac5844bd;hb=HEAD;hpb=069355dabccdbb5fd15a4c7cabd7ef3b96963182 diff --git a/t/aggregate/live_engine_request_body.t b/t/aggregate/live_engine_request_body.t index 40d7ab2..879ef14 100644 --- a/t/aggregate/live_engine_request_body.t +++ b/t/aggregate/live_engine_request_body.t @@ -1,12 +1,10 @@ -#!perl - use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 21; +use Test::More tests => 23; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -39,6 +37,7 @@ use HTTP::Request::Common; isa_ok( $creq, 'Catalyst::Request' ); is( $creq->method, 'POST', 'Catalyst::Request method' ); is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' ); + is( $creq->{__body_type}, 'File::Temp' ); is( $creq->content_length, $request->content_length, 'Catalyst::Request Content-Length' ); } @@ -72,6 +71,7 @@ use HTTP::Request::Common; isa_ok( $creq, 'Catalyst::Request' ); is( $creq->method, 'POST', 'Catalyst::Request method' ); is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' ); + is( $creq->{__body_type}, 'File::Temp' ); is( $creq->content_length, $request->content_length, 'Catalyst::Request Content-Length' ); } @@ -79,13 +79,17 @@ use HTTP::Request::Common; # 5.80 regression, see note in Catalyst::Plugin::Test::Plugin { my $request = GET( - 'http://localhost/have_req_body_in_prepare_action', + 'http://localhost/dump/response', 'Content-Type' => 'text/plain', 'Content' => 'x' x 100_000 ); ok( my $response = request($request), 'Request' ); + my $server = $response->header('server') || ''; + local $TODO = 'lighttpd refuses GET with body' + if $server =~ /lighttpd/; + ok( $response->is_success, 'Response Successful 2xx' ); - like( $response->content, qr/^[1-9]/, 'Has body' ); + ok( $response->header('X-Have-Request-Body'), 'X-Have-Request-Body set' ); }