On Tue, Dec 16, 2008 at 06:20:43PM +0000, Tomas Doran wrote:
> Do you fancy writing a test for the issue so we can actually prove it is 
> gone?

Well, it would could be something like this:

use lib "t/lib";
use Test::WWW::Mechanize::Catalyst "SessionTestApp";

$SessionTestApp::store_session_data = 0;
my $wrote_session;
{
    no warnings 'redefine';
    *SessionTestApp::store_session_data = sub {
        $wrote_session++ if $_[1] =~ /^session:/;
    }
}

my $ua = Test::WWW::Mechanize::Catalyst->new;

$ua->get_ok( 'http://localhost/login', 'call $c->session'  );
ok( !$wrote_session, 'Did not write session on read only' );


But, the plugin also always writes an "expires:" key into the store
(hence the /^session:/ match above), so if the goal is to not write to
the store unless there's something to store then that needs looking
at, too.


-- 
Bill Moseley
[email protected]
Sent from my iMutt


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to