X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_response_cookies.t;h=af438cdca61c9bf6f83e9bf21d67efdf49df5562;hb=a0b5065e3dd43fea2ca17f4f2ae7cbe1958057d4;hp=59b2a1d60364237f410c9eaf31c7eff2a4ea1ee6;hpb=86c71af01d64c0641a9ae90a35fef2872ae046e9;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_engine_response_cookies.t b/t/aggregate/live_engine_response_cookies.t index 59b2a1d..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'; @@ -33,8 +31,6 @@ my $expected = { is_deeply( $cookies, $expected, 'Response Cookies' ); } -# XXX: these fail on remote servers due to LWP max_redirect 0 bug: -# http://rt.cpan.org/Ticket/Display.html?id=40260 { ok( my $response = request('http://localhost/engine/response/cookies/two'), 'Request' ); @@ -73,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; +