[Catalyst-commits] r8029 - in trunk/CatalystX-Imports/t: .
lib/TestApp/Controller
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sat Jun 28 15:15:26 BST 2008
Author: rafl
Date: 2008-06-28 15:15:26 +0100 (Sat, 28 Jun 2008)
New Revision: 8029
Modified:
trunk/CatalystX-Imports/t/25-vars-session.t
trunk/CatalystX-Imports/t/lib/TestApp/Controller/Vars.pm
Log:
Test flash vars.
Modified: trunk/CatalystX-Imports/t/25-vars-session.t
===================================================================
--- trunk/CatalystX-Imports/t/25-vars-session.t 2008-06-28 14:15:15 UTC (rev 8028)
+++ trunk/CatalystX-Imports/t/25-vars-session.t 2008-06-28 14:15:26 UTC (rev 8029)
@@ -4,7 +4,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 3;
+use Test::More tests => 6;
use Test::WWW::Mechanize::Catalyst 'TestApp';
@@ -13,3 +13,7 @@
$ua->get_ok('http://localhost/vars/set_session/23');
$ua->get_ok('http://localhost/vars/test_session');
$ua->content_is('23');
+
+$ua->get_ok('http://localhost/vars/set_flash/42');
+$ua->get_ok('http://localhost/vars/test_flash');
+$ua->content_is('42');
Modified: trunk/CatalystX-Imports/t/lib/TestApp/Controller/Vars.pm
===================================================================
--- trunk/CatalystX-Imports/t/lib/TestApp/Controller/Vars.pm 2008-06-28 14:15:15 UTC (rev 8028)
+++ trunk/CatalystX-Imports/t/lib/TestApp/Controller/Vars.pm 2008-06-28 14:15:26 UTC (rev 8029)
@@ -7,7 +7,8 @@
use CatalystX::Imports
Context => ':all',
Vars => { Stash => [qw( $foo @bar %baz )],
- Session => [qw( $moo )] };
+ Session => [qw( $moo )],
+ Flash => [qw( $kooh )] };
sub test_self: Local { $_[1]->res->body( ref $self ) }
sub test_ctx: Local { $_[1]->res->body( ref $ctx ) }
@@ -55,4 +56,12 @@
$ctx->res->body( $moo );
}
+
+sub set_flash: Local {
+ $kooh = $args[0];
+}
+
+sub test_flash: Local {
+ $ctx->res->body( $kooh );
+}
1;
More information about the Catalyst-commits
mailing list