8 eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
10 "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
13 require Test::WWW::Mechanize::PSGI;
14 #Test::WWW::Mechanize::Catalyst->VERSION(0.51);
17 'Test::WWW::Mechanize::PSGI is required for this test';
23 use Test::WWW::Mechanize::PSGI;
25 my $ua = Test::WWW::Mechanize::PSGI->new(
26 app => SessionTestApp->psgi_app(@_),
30 # Test without delete __address
31 local $ENV{REMOTE_ADDR} = "192.168.1.1";
33 $ua->get_ok( "http://localhost/login" );
34 $ua->content_contains('logged in');
36 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
37 $ua->content_contains('session variable set');
42 my $app = SessionTestApp->psgi_app(@_);
43 my $ua2 = Test::WWW::Mechanize::PSGI->new(
47 $ua2->get_ok( "http://localhost/get_session_variable/logged");
48 $ua2->content_contains('VAR_logged=n.a.');
51 local $ENV{REMOTE_ADDR} = "192.168.1.1";
53 $ua->get_ok( "http://localhost/login_without_address" );
54 $ua->content_contains('logged in (without address)');
56 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
57 $ua->content_contains('session variable set');
60 local $ENV{REMOTE_ADDR} = "192.168.1.2";
62 $ua->get_ok( "http://localhost/get_session_variable/logged" );
63 $ua->content_contains('VAR_logged=in');