7 use lib "$FindBin::Bin/../../lib";
9 use Test::More no_plan => 1;
10 use Catalyst::Test 'TestApp';
12 use HTTP::Headers::Util 'split_header_words';
16 Catalyst => [ qw( Catalyst Cool path / ) ],
17 Cool => [ qw( Cool Catalyst path / ) ]
21 ok( my $response = request('http://localhost/engine/response/cookies/one'), 'Request' );
22 ok( $response->is_success, 'Response Successful 2xx' );
23 is( $response->content_type, 'text/plain', 'Response Content-Type' );
24 is( $response->header('X-Catalyst-Action'), 'engine/response/cookies/one', 'Test Action' );
28 for my $cookie ( split_header_words( $response->header('Set-Cookie') ) ) {
29 $cookies->{ $cookie->[0] } = $cookie;
32 is_deeply( $cookies, $expected, 'Response Cookies' );
36 ok( my $response = request('http://localhost/engine/response/cookies/two'), 'Request' );
37 ok( $response->is_redirect, 'Response Redirection 3xx' );
38 is( $response->code, 302, 'Response Code' );
39 is( $response->header('X-Catalyst-Action'), 'engine/response/cookies/two', 'Test Action' );
43 for my $cookie ( split_header_words( $response->header('Set-Cookie') ) ) {
44 $cookies->{ $cookie->[0] } = $cookie;
47 is_deeply( $cookies, $expected, 'Response Cookies' );