X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_app.t;h=6b9c3add2a05289a22550272c9f5ec913122a78b;hb=601be17a9e3850de086eed40070ccc5157fa191f;hp=97f7102f8e4eb340da2f606e1e2439c43ead0b83;hpb=182d94606f9f8e6440d576b60998cfae0e5fb17c;p=catagits%2FCatalyst-Plugin-Session.git diff --git a/t/live_app.t b/t/live_app.t index 97f7102..6b9c3ad 100644 --- a/t/live_app.t +++ b/t/live_app.t @@ -93,19 +93,17 @@ $ua4->content_contains( "please login", "ua4 not logged in" ); $ua4->get_ok( "http://localhost/login", "log ua4 in" ); $ua4->content_contains( "logged in", "ua4 logged in" ); -$ua4->get_ok( "http://localhost/extend_session_expires", "ua4 extend expire session" ); -my ( $ua4_expires ) = ($ua4->content =~ /(\d+)$/); - -ok( ($ua4_expires - time() - 86400) >= 0, 'extend_session_expires with really long value' ); - -sleep 1; +$ua4->get( "http://localhost/page", "get page" ); +my ( $ua4_expires1 ) = ($ua4->content =~ /(\d+)$/); +$ua4->get( "http://localhost/page", "get page" ); +my ( $ua4_expires2 ) = ($ua4->content =~ /(\d+)$/); +is( $ua4_expires1, $ua4_expires2, 'expires has not changed' ); +$ua4->get( "http://localhost/change_session_expires", "get page" ); $ua4->get( "http://localhost/page", "get page" ); -my ( $ua4_expires_updated ) = ($ua4->content =~ /(\d+)$/); -diag( "ua4_expires => $ua4_expires"); -diag( "ua4_expires_updated => $ua4_expires_updated"); -ok( $ua4_expires < $ua4_expires_updated, 'update extended session' ); +my ( $ua4_expires3 ) = ($ua4->content =~ /(\d+)$/); +ok( $ua4_expires3 > ( $ua4_expires1 + 30000000), 'expires has been extended' ); diag("Testing against Catalyst $Catalyst::VERSION"); diag("Testing Catalyst::Plugin::Session $Catalyst::Plugin::Session::VERSION");