X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_response_cookies.t;h=af438cdca61c9bf6f83e9bf21d67efdf49df5562;hp=5f2f2266c6605e7e2a428a5ad461af31615dd61e;hb=35b3434762d426e0cd5e04eb735291f8ca7ea08e;hpb=29d278fd1365c9ff3d6b7ae05379980cbfef2615 diff --git a/t/aggregate/live_engine_response_cookies.t b/t/aggregate/live_engine_response_cookies.t index 5f2f226..af438cd 100644 --- a/t/aggregate/live_engine_response_cookies.t +++ b/t/aggregate/live_engine_response_cookies.t @@ -1,12 +1,10 @@ -#!perl - use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 15; +use Test::More; use Catalyst::Test 'TestApp'; use HTTP::Headers::Util 'split_header_words'; @@ -71,3 +69,27 @@ my $expected = { this_is_the_real_name => [ qw(this_is_the_real_name foo&bar path /) ], # not "object" }, 'Response Cookies' ); } + +{ + my $response; + ok( $response = request('http://localhost/engine/response/cookies/four'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ) or diag explain $response; + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'engine/response/cookies/four', '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, { + good => [qw|good good_cookie path /|], + }, 'Response Cookies' ); +} + +done_testing; +