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_prepare_parameters.t;fp=t%2Faggregate%2Flive_engine_request_prepare_parameters.t;h=e933fb56247d5d170ff41efef626f6896c41742e;hp=0000000000000000000000000000000000000000;hb=4055796051cccaa2276eca36b8661e3f785f7be3;hpb=cc02d51ec40f498a948d21d3fe545671735df4e3 diff --git a/t/aggregate/live_engine_request_prepare_parameters.t b/t/aggregate/live_engine_request_prepare_parameters.t new file mode 100755 index 0000000..e933fb5 --- /dev/null +++ b/t/aggregate/live_engine_request_prepare_parameters.t @@ -0,0 +1,39 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use Test::More tests => 8; +use Catalyst::Test 'TestApp'; + +use Catalyst::Request; +use HTTP::Headers; +use HTTP::Request::Common; + +{ + my $creq; + + my $parameters = { 'a' => [qw(A b C d E f G)], }; + + my $query = join( '&', map { 'a=' . $_ } @{ $parameters->{a} } ); + + ok( my $response = request("http://localhost/dump/prepare_parameters?$query"), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); + isa_ok( $creq, 'Catalyst::Request' ); + is( $creq->method, 'GET', 'Catalyst::Request method' ); + is_deeply( $creq->parameters, $parameters, + 'Catalyst::Request parameters' ); +} + +