X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_engine_response_cookies.t;h=abd0476bdcbc7833108fbfdc4dafa17a7897248d;hb=09461385e3f0f62cbf3a95a71d00f71e1a42ca75;hp=e87bb1d846187e04d312f1c6b20e2d8c2edff4dc;hpb=f1bbebac7a9ae06ed2b750440d4369dedb5d9e80;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_engine_response_cookies.t b/t/live_engine_response_cookies.t index e87bb1d..abd0476 100644 --- a/t/live_engine_response_cookies.t +++ b/t/live_engine_response_cookies.t @@ -6,12 +6,12 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 10; +use Test::More tests => 15; use Catalyst::Test 'TestApp'; use HTTP::Headers::Util 'split_header_words'; my $expected = { - Catalyst => [qw|Catalyst Cool path /|], + Catalyst => [qw|Catalyst Cool path /bah|], Cool => [qw|Cool Catalyst path /|] }; @@ -50,3 +50,24 @@ my $expected = { is_deeply( $cookies, $expected, 'Response Cookies' ); } + +{ + ok( my $response = request('http://localhost/engine/response/cookies/three'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'engine/response/cookies/three', 'Test Action' ); + + my $cookies = {}; + + for my $string ( $response->header('Set-Cookie') ) { + my $cookie = [ split_header_words $string]; + $cookies->{ $cookie->[0]->[0] } = $cookie->[0]; + } + + is_deeply( $cookies, { + hash => [ qw(hash a&b&c path /) ], + this_is_the_real_name => [ qw(this_is_the_real_name foo&bar path /) ], # not "object" + }, 'Response Cookies' ); +}