From: Jonathan Rockway Date: Fri, 10 Aug 2007 03:51:16 +0000 (+0000) Subject: fix State::Cookie so that tests work with newer TWMCs X-Git-Tag: v0.08~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Session-State-Cookie.git;a=commitdiff_plain;h=a79a56a8332eb8daf2f85eceb0a1eea66324e91d fix State::Cookie so that tests work with newer TWMCs --- diff --git a/Changes b/Changes index cb346a9..ed72a68 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Catalyst::Plugin::Session::State::Cookie +0.08 2007-08-09 9:46PM (+0500) + - Fix live test with Mech version 0.37+ + 0.07 2007-04-04 23:10:00 - Fix the bug that caused sessions to expire immediately when another session was deleted previously in the same request cycle diff --git a/lib/Catalyst/Plugin/Session/State/Cookie.pm b/lib/Catalyst/Plugin/Session/State/Cookie.pm index 865fb48..669013b 100644 --- a/lib/Catalyst/Plugin/Session/State/Cookie.pm +++ b/lib/Catalyst/Plugin/Session/State/Cookie.pm @@ -7,7 +7,7 @@ use warnings; use NEXT; use Catalyst::Utils (); -our $VERSION = "0.07"; +our $VERSION = "0.08"; BEGIN { __PACKAGE__->mk_accessors(qw/_deleted_session_id/) } @@ -242,6 +242,7 @@ Andy Grundman Christian Hansen Yuval Kogman, C Marcus Ramberg +Jonathan Rockway, C Sebastian Riedel =head1 COPYRIGHT diff --git a/t/live_app.t b/t/live_app.t index 126c066..3c814fb 100644 --- a/t/live_app.t +++ b/t/live_app.t @@ -49,27 +49,27 @@ use Test::WWW::Mechanize::Catalyst qw/CookieTestApp/; my $m = Test::WWW::Mechanize::Catalyst->new; -$m->get_ok( "http://foo.com/stream", "get page" ); +$m->get_ok( "http://localhost/stream", "get page" ); $m->content_contains( "hit number 1", "session data created" ); my $expired; -$m->cookie_jar->scan( sub { $expired = $_[8] } ); +$m->cookie_jar->scan( sub { $expired = $_[8]; warn join":",@_; } ); -$m->get_ok( "http://foo.com/page", "get page" ); +$m->get_ok( "http://localhost/page", "get page" ); $m->content_contains( "hit number 2", "session data restored" ); -$m->get_ok( "http://foo.com/stream", "get stream" ); +$m->get_ok( "http://localhost/stream", "get stream" ); $m->content_contains( "hit number 3", "session data restored" ); -sleep 2; +sleep 1; -$m->get_ok( "http://foo.com/page", "get stream" ); +$m->get_ok( "http://localhost/page", "get stream" ); $m->content_contains( "hit number 4", "session data restored" ); my $updated_expired; -$m->cookie_jar->scan( sub { $updated_expired = $_[8] } ); +$m->cookie_jar->scan( sub { $updated_expired = $_[8]; warn join":",@_; } ); cmp_ok( $expired, "<", $updated_expired, "cookie expiration was extended" ); -$m->get_ok( "http://foo.com/deleteme", "get page" ); +$m->get_ok( "http://localhost/deleteme", "get page" ); $m->content_is( 1, 'session id changed' );