X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_request_body.t;h=0abe1752d1f26dbfac839721a4de9a8bec4dfe1e;hb=480d94b5f34577816d44fe05389ca5a085179363;hp=0a6dea2aae00229ef7d08447a8938f5dea063e61;hpb=b1e0cb6d4ded3d4223517d4adce6caef23112946;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_engine_request_body.t b/t/aggregate/live_engine_request_body.t index 0a6dea2..0abe175 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 => 18; +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,22 +71,21 @@ 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' ); } # 5.80 regression, see note in Catalyst::Plugin::Test::Plugin -TODO: { - local $TODO = 'On demand request body parsing in prepare_action broken'; - +{ 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' ); 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' ); }