[Catalyst-commits] r6930 - trunk/Catalyst-Plugin-Session-State-Cookie/t

jrockway at dev.catalyst.perl.org jrockway at dev.catalyst.perl.org
Sat Sep 22 01:49:42 GMT 2007


Author: jrockway
Date: 2007-09-22 01:49:42 +0100 (Sat, 22 Sep 2007)
New Revision: 6930

Modified:
   trunk/Catalyst-Plugin-Session-State-Cookie/t/live_app.t
Log:
add a test for streaming cookie expiration updates

Modified: trunk/Catalyst-Plugin-Session-State-Cookie/t/live_app.t
===================================================================
--- trunk/Catalyst-Plugin-Session-State-Cookie/t/live_app.t	2007-09-21 15:29:25 UTC (rev 6929)
+++ trunk/Catalyst-Plugin-Session-State-Cookie/t/live_app.t	2007-09-22 00:49:42 UTC (rev 6930)
@@ -64,13 +64,24 @@
 
 sleep 1;
 
-$m->get_ok( "http://localhost/page", "get stream" );
+$m->get_ok( "http://localhost/stream", "get page" );
 $m->content_contains( "hit number 4", "session data restored" );
 
 my $updated_expired;
 $m->cookie_jar->scan( sub { $updated_expired = $_[8]; } );
-
 cmp_ok( $expired, "<", $updated_expired, "cookie expiration was extended" );
 
+$expired = $m->cookie_jar->scan( sub { $expired = $_[8] } );
+$m->get_ok( "http://localhost/page", "get page again");
+$m->content_contains( "hit number 5", "session data restored (blah)" );
+
+sleep 1;
+
+$m->get_ok( "http://localhost/stream", "get stream" );
+$m->content_contains( "hit number 6", "session data restored" );
+
+$m->cookie_jar->scan( sub { $updated_expired = $_[8]; } );
+cmp_ok( $expired, "<", $updated_expired, "streaming also extends cookie" );
+
 $m->get_ok( "http://localhost/deleteme", "get page" );
 $m->content_is( 1, 'session id changed' );




More information about the Catalyst-commits mailing list