moving to catagits as primary repo, but continue to publish github in metadata
[catagits/Catalyst-Plugin-Session-State-Stash.git] / t / 05-live.t
CommitLineData
51d6e253 1#!/usr/bin/perl
642b19cf 2
3use strict;
4use warnings;
5
effd6244 6use FindBin qw/$Bin/;
7use lib "$Bin/lib";
8
642b19cf 9use URI::Escape;
10use Test::More;
11
12BEGIN {
13 eval { require Test::WWW::Mechanize::Catalyst };
14 plan skip_all =>
15 "This test requires Test::WWW::Mechanize::Catalyst in order to run"
16 if $@;
17 plan skip_all => 'Test::WWW::Mechanize::Catalyst >= 0.40 required' if $Test::WWW::Mechanize::Catalyst::VERSION < 0.40;
18}
19
642b19cf 20use Test::WWW::Mechanize::Catalyst qw/TestApp/;
21
22my $m = Test::WWW::Mechanize::Catalyst->new;
23
24#Number of tests to run. A begin block every 10 will ensure the count is correct
25my $tests;
26plan tests => $tests;
27
28$m->get_ok( "http://localhost/start_session", "get page" );
29my $session = uri_escape($m->content);
30
31$m->get_ok( "http://localhost/page/$session", "get page" );
32$m->content_contains( "hit number 2", "session data restored" );
33
34$m->get_ok( "http://localhost/stream/$session", "get stream" );
35$m->content_contains( "hit number 3", "session data restored" );
36
37BEGIN { $tests += 5; }
38
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" );
42
43TODO: {
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' );
46}
51d6e253 47BEGIN { $tests += 4; }