7 eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
9 "Catalyst::Plugin::Session::State::Cookie version 0.03 or higher is required for this test";
11 eval { require Test::WWW::Mechanize::Catalyst }
13 'Test::WWW::Mechanize::Catalyst is required for this test';
20 use Test::WWW::Mechanize::Catalyst 'FlashTestApp';
22 my $ua = Test::WWW::Mechanize::Catalyst->new;
24 # flash absent for initial request
25 $ua->get_ok( "http://localhost/first");
26 $ua->content_contains( "flash is not set", "not set");
28 # present for 1st req.
29 $ua->get_ok( "http://localhost/second");
30 $ua->content_contains( "flash set first time", "set first");
32 # should be the same 2nd req.
33 $ua->get_ok( "http://localhost/third");
34 $ua->content_contains( "flash set second time", "set second");
36 # and the third request, flash->{is_set} has the same value as 2nd.
37 $ua->get_ok( "http://localhost/fourth");
38 $ua->content_contains( "flash set 3rd time, same val as prev.", "set third");
41 # and should be absent again for the 4th req.
42 $ua->get_ok( "http://localhost/fifth");
43 $ua->content_contains( "flash is not", "flash has gone");