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=0abe1752d1f26dbfac839721a4de9a8bec4dfe1e;hp=1897af3486f554f3e23eb6b69bda0372ef9c57be;hb=7064f69b1dfb59d1f3bad647b2097d0320acce8a;hpb=6e3de58fc7d0a4302fe9791c36346839ad91fb12 diff --git a/t/aggregate/live_engine_request_body.t b/t/aggregate/live_engine_request_body.t index 1897af3..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 => 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,16 +79,13 @@ 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' ); ok( $response->is_success, 'Response Successful 2xx' ); - TODO: { - local $TODO = 'On demand request body parsing in prepare_action broken'; - like( $response->content, qr/^[1-9]/, 'Has body' ); - } + ok( $response->header('X-Have-Request-Body'), 'X-Have-Request-Body set' ); }