More comprehensive cookie tests + the ability to specify an object instead of a hash
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Engine / Response / Cookies.pm
index a66fdca..4a9b2b8 100644 (file)
@@ -3,18 +3,33 @@ package TestApp::Controller::Engine::Response::Cookies;
 use strict;
 use base 'Catalyst::Base';
 
-sub one : Relative {
+sub one : Local {
     my ( $self, $c ) = @_;
-    $c->res->cookies->{Catalyst} = { value => 'Cool',     path => '/' };
+    $c->res->cookies->{Catalyst} = { value => 'Cool',     path => '/bah' };
     $c->res->cookies->{Cool}     = { value => 'Catalyst', path => '/' };
     $c->forward('TestApp::View::Dump::Request');
 }
 
-sub two : Relative {
+sub two : Local {
     my ( $self, $c ) = @_;
-    $c->res->cookies->{Catalyst} = { value => 'Cool',     path => '/' };
+    $c->res->cookies->{Catalyst} = { value => 'Cool',     path => '/bah' };
     $c->res->cookies->{Cool}     = { value => 'Catalyst', path => '/' };
     $c->res->redirect('http://www.google.com/');
 }
 
+sub three : Local {
+    my ( $self, $c ) = @_;
+
+    $c->res->cookies->{object} = CGI::Simple::Cookie->new(
+        -name => "this_is_the_real_name",
+        -value => [qw/foo bar/],
+    );
+
+    $c->res->cookies->{hash} = {
+        value => [qw/a b c/],
+    };
+
+    $c->forward('TestApp::View::Dump::Request');
+}
+
 1;