7 eval { require Catalyst::Plugin::Session::State::Cookie }
9 "Catalyst::Plugin::Session::State::Cookie is required for this test";
11 eval { require Catalyst::Plugin::Session::Store::File}
13 'Catalyst::Plugin::Session::Store::File is required for this test';
14 eval { require Test::WWW::Mechanize::Catalyst }
16 'Test::WWW::Mechanize::Catalyst is required for this test';
23 use Test::WWW::Mechanize::Catalyst 'FlashTestApp';
25 my $ua = Test::WWW::Mechanize::Catalyst->new;
27 # flash absent for initial request
28 $ua->get_ok( "http://localhost/first") for $ua;
29 $ua->content_contains( "flash is not set", "not set");
31 # present for 1st req.
32 $ua->get_ok( "http://localhost/second") for $ua;
33 $ua->content_contains( "flash set first time", "set first");
35 # should be the same 2nd req.
36 $ua->get_ok( "http://localhost/third") for $ua;
37 $ua->content_contains( "flash set second time", "set second");
39 # and the third request, flash->{is_set} has the same value as 2nd.
40 $ua->get_ok( "http://localhost/fourth") for $ua;
41 $ua->content_contains( "flash set 3rd time, same val as prev.", "set third");
44 # and should be absent again for the 4th req.
45 $ua->get_ok( "http://localhost/fifth") for $ua;
46 $ua->content_contains( "flash is not", "flash has gone");