From: Tomas Doran Date: Mon, 19 Jul 2010 19:21:29 +0000 (+0000) Subject: Fix RT#58856 X-Git-Tag: v0.31~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=834ab0b872c4263ed86da250cc1a231ada853c78;hp=2110d07847641c3e7aa7fa1444c05b975e2480e7;p=catagits%2FCatalyst-Plugin-Session.git Fix RT#58856 --- diff --git a/Changes b/Changes index 301c8b4..9f61165 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Catalyst::Plugin::Session + - Fix session being loaded by call to dump_these in debug mode + (RT#58856) + 0.30 2010-06-24 - Fix Makefile.PL's is_upgrading_needed() routine (RT #58771) diff --git a/Makefile.PL b/Makefile.PL index e9482f6..69bbbbf 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -26,7 +26,7 @@ requires 'Moose' => '0.76'; requires 'Tie::RefHash' => '1.34'; # for Test::Store -requires 'Test::More'; +requires 'Test::More' => '0.88'; test_requires 'Test::Deep'; test_requires 'Test::Exception'; diff --git a/lib/Catalyst/Plugin/Session.pm b/lib/Catalyst/Plugin/Session.pm index 89e39aa..3a28416 100644 --- a/lib/Catalyst/Plugin/Session.pm +++ b/lib/Catalyst/Plugin/Session.pm @@ -578,7 +578,7 @@ sub dump_these { ( $c->maybe::next::method(), - $c->sessionid + $c->_sessionid ? ( [ "Session ID" => $c->sessionid ], [ Session => $c->session ], ) : () ); diff --git a/t/lib/SessionTestApp/Controller/Root.pm b/t/lib/SessionTestApp/Controller/Root.pm index 36033be..ff80dd6 100644 --- a/t/lib/SessionTestApp/Controller/Root.pm +++ b/t/lib/SessionTestApp/Controller/Root.pm @@ -88,4 +88,16 @@ sub accessor_test : Global { } } +sub dump_these_loads_session : Global { + my ($self, $c) = @_; + + $c->dump_these(); + if ($c->_session) { + $c->res->write('LOADED') + } + else { + $c->res->write('NOT'); + } +} + 1; diff --git a/t/live_app.t b/t/live_app.t index f2b1bd1..cbc7cc5 100644 --- a/t/live_app.t +++ b/t/live_app.t @@ -16,8 +16,6 @@ BEGIN { } or plan skip_all => 'Test::WWW::Mechanize::Catalyst >= 0.51 is required for this test'; - - plan tests => 36; } use lib "t/lib"; @@ -83,6 +81,12 @@ $_->get_ok( "http://localhost/page", "get main page" ) for $ua1, $ua2; $ua1->content_contains( "please login", "ua1 not logged in" ); $ua2->content_contains( "please login", "ua2 not logged in" ); +my $ua3 = Test::WWW::Mechanize::Catalyst->new; +$ua3->get_ok( "http://localhost/login", "log ua3 in" ); +$ua3->get_ok( "http://localhost/dump_these_loads_session"); +$ua3->content_contains('NOT'); + diag("Testing against Catalyst $Catalyst::VERSION"); diag("Testing Catalyst::Plugin::Session $Catalyst::Plugin::Session::VERSION"); +done_testing;