13 eval { require Test::WWW::Mechanize::Catalyst };
15 "This test requires Test::WWW::Mechanize::Catalyst in order to run"
17 plan skip_all => 'Test::WWW::Mechanize::Catalyst >= 0.40 required' if $Test::WWW::Mechanize::Catalyst::VERSION < 0.40;
20 use Test::WWW::Mechanize::Catalyst qw/TestApp/;
22 my $m = Test::WWW::Mechanize::Catalyst->new;
24 #Number of tests to run. A begin block every 10 will ensure the count is correct
28 $m->get_ok( "http://localhost/start_session", "get page" );
29 my $session = uri_escape($m->content);
31 $m->get_ok( "http://localhost/page/$session", "get page" );
32 $m->content_contains( "hit number 2", "session data restored" );
34 $m->get_ok( "http://localhost/stream/$session", "get stream" );
35 $m->content_contains( "hit number 3", "session data restored" );
37 BEGIN { $tests += 5; }
39 $m->get_ok( "http://localhost/stream/$session", "get page" );
40 $m->content_contains( "hit number 4", "session data restored" );
41 $m->get_ok( "http://localhost/deleteme/$session", "get page" );
44 local $TODO = "Changing sessions is broken and I've had no success fixing it. Patches welcome";
45 $m->content_is( 'PASS' , 'session id changed' );
47 BEGIN { $tests += 4; }