X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fengine%2Frequest%2Fparameters.t;fp=t%2Fengine%2Frequest%2Fparameters.t;h=cbedc8982d43cd88a98b1fce65f02d9d5d9e621e;hb=b9e9fff6b976cb138c6d56f10c37ebc20216b74f;hp=6cf7da91c1c52422acad890344e2a882d609cf9f;hpb=adfe7ead04d6f4431a624299c529d6ff3a396166;p=catagits%2FCatalyst-Runtime.git diff --git a/t/engine/request/parameters.t b/t/engine/request/parameters.t index 6cf7da9..cbedc89 100644 --- a/t/engine/request/parameters.t +++ b/t/engine/request/parameters.t @@ -6,7 +6,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../lib"; -use Test::More tests => 11; +use Test::More tests => 19; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -19,6 +19,25 @@ use URI; 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/request?$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' ); +} + +{ + my $creq; + + my $parameters = { + 'a' => [qw(A b C d E f G)], '%' => [ '%', '"', '& - &' ], };