kd's tests updated, code fixed
[catagits/Catalyst-Plugin-Session.git] / t / lib / FlashTestApp.pm
index ff8395b..b7e0189 100644 (file)
@@ -1,10 +1,11 @@
 #!/usr/bin/perl -w
 
 package FlashTestApp;
-use Catalyst qw/Session Session::Store::File Session::State::Cookie/;
+use Catalyst qw/Session Session::Store::Dummy Session::State::Cookie/;
 
 use strict;
 use warnings;
+no warnings 'uninitialized';
 
 sub default : Private {
     my ($self, $c) = @_;
@@ -16,7 +17,7 @@ sub first : Global {
     my ( $self, $c ) = @_;
     if ( ! $c->flash->{is_set}) {
         $c->stash->{message} = "flash is not set";
-        $c->stash->{is_set} = 1;
+        $c->flash->{is_set} = 1;
     }
 }
 
@@ -32,7 +33,7 @@ sub third : Global {
     my ( $self, $c ) = @_;
     if ($c->flash->{is_set} == 2) {
         $c->stash->{message} = "flash set second time";
-        $c->flash->{is_set} = 2;
+        $c->keep_flash("is_set");
     }
 }
 
@@ -48,7 +49,7 @@ sub fifth : Global {
     $c->forward('/first');
 }
 
-sub end : Local {
+sub end : Private {
     my ($self, $c) = @_;
     $c->res->output($c->stash->{message});
 }