8 eval { require Test::WWW::Mechanize::Catalyst }
10 'Test::WWW::Mechanize::Catalyst is required for this test';
17 use Test::WWW::Mechanize::Catalyst 'FlashTestApp';
19 my $ua = Test::WWW::Mechanize::Catalyst->new;
21 # flash absent for initial request
22 $ua->get_ok("http://localhost/first");
23 $ua->content_contains( "flash is not set", "not set" );
25 # present for 1st req.
26 $ua->get_ok("http://localhost/second");
27 $ua->content_contains( "flash set first time", "set first" );
29 # should be the same 2nd req.
30 $ua->get_ok("http://localhost/third");
31 $ua->content_contains( "flash set second time", "set second" );
33 # and the third request, flash->{is_set} has the same value as 2nd.
34 $ua->get_ok("http://localhost/fourth");
35 $ua->content_contains( "flash set 3rd time, same val as prev.", "set third" );
37 # and should be absent again for the 4th req.
38 $ua->get_ok("http://localhost/fifth");
39 $ua->content_contains( "flash is not", "flash has gone" );