[Catalyst-commits] r10553 - in Catalyst-Plugin-Session/0.00/trunk: . lib/Catalyst/Plugin t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Tue Jun 16 19:42:55 GMT 2009


Author: t0m
Date: 2009-06-16 19:42:55 +0000 (Tue, 16 Jun 2009)
New Revision: 10553

Added:
   Catalyst-Plugin-Session/0.00/trunk/t/live_verify_user_agent.t
Modified:
   Catalyst-Plugin-Session/0.00/trunk/Changes
   Catalyst-Plugin-Session/0.00/trunk/MANIFEST.SKIP
   Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm
Log:
Checking in changes prior to tagging of version 0.23.  Changelog diff is:

Index: Changes
===================================================================
--- Changes	(revision 10552)
+++ Changes	(working copy)
@@ -1,5 +1,6 @@
 Revision history for Perl extension Catalyst::Plugin::Session
 
+0.23 2009-06-16
         - Add the verify_user_agent config parameter (kmx)
         - Add a test case to prove that logging in with a session cookie still 
           causes a new cookie to be issued for you, proving that the code is


Modified: Catalyst-Plugin-Session/0.00/trunk/Changes
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/Changes	2009-06-16 19:34:51 UTC (rev 10552)
+++ Catalyst-Plugin-Session/0.00/trunk/Changes	2009-06-16 19:42:55 UTC (rev 10553)
@@ -1,5 +1,6 @@
 Revision history for Perl extension Catalyst::Plugin::Session
 
+0.23 2009-06-16
         - Add the verify_user_agent config parameter (kmx)
         - Add a test case to prove that logging in with a session cookie still 
           causes a new cookie to be issued for you, proving that the code is

Modified: Catalyst-Plugin-Session/0.00/trunk/MANIFEST.SKIP
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/MANIFEST.SKIP	2009-06-16 19:34:51 UTC (rev 10552)
+++ Catalyst-Plugin-Session/0.00/trunk/MANIFEST.SKIP	2009-06-16 19:42:55 UTC (rev 10553)
@@ -4,6 +4,8 @@
 ,v$
 \B\.svn\b
 
+\bIDEAS.txt$
+
 # Avoid Makemaker generated and utility files.
 \bMakefile$
 \bblib

Modified: Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm	2009-06-16 19:34:51 UTC (rev 10552)
+++ Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm	2009-06-16 19:42:55 UTC (rev 10553)
@@ -13,7 +13,7 @@
 
 use namespace::clean -except => 'meta';
 
-our $VERSION = '0.22';
+our $VERSION = '0.23';
 
 my @session_data_accessors; # used in delete_session
 
@@ -974,7 +974,7 @@
 
 =item __user_agent
 
-The value of C<< $c->request->user_agent>> at the time the session was created.
+The value of C<< $c->request->user_agent >> at the time the session was created.
 This value is only populated if C<verify_user_agent> is true in the configuration.
 
 =back

Added: Catalyst-Plugin-Session/0.00/trunk/t/live_verify_user_agent.t
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/t/live_verify_user_agent.t	                        (rev 0)
+++ Catalyst-Plugin-Session/0.00/trunk/t/live_verify_user_agent.t	2009-06-16 19:42:55 UTC (rev 10553)
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+    eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
+      or plan skip_all =>
+      "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
+
+    eval { require Test::WWW::Mechanize::Catalyst }
+      or plan skip_all =>
+      "Test::WWW::Mechanize::Catalyst is required for this test";
+
+    plan tests => 12;
+}
+
+use lib "t/lib";
+use Test::WWW::Mechanize::Catalyst "SessionTestApp";
+
+my $ua = Test::WWW::Mechanize::Catalyst->new( { agent => 'Initial user_agent'} );
+$ua->get_ok( "http://localhost/user_agent", "get initial user_agent" );
+$ua->content_contains( "UA=Initial user_agent", "test initial user_agent" );
+
+$ua->get_ok( "http://localhost/page", "initial get main page" );
+$ua->content_contains( "please login", "ua not logged in" );
+
+$ua->get_ok( "http://localhost/login", "log ua in" );
+$ua->content_contains( "logged in", "ua logged in" );
+
+$ua->get_ok( "http://localhost/page", "get main page" );
+$ua->content_contains( "you are logged in", "ua logged in" );
+
+$ua->agent('Changed user_agent');
+$ua->get_ok( "http://localhost/user_agent", "get changed user_agent" );
+$ua->content_contains( "UA=Changed user_agent", "test changed user_agent" );
+
+$ua->get_ok( "http://localhost/page", "test deleted session" );
+$ua->content_contains( "please login", "ua not logged in" );




More information about the Catalyst-commits mailing list