9 eval { require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
11 plan skip_all => "This test needs Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed";
22 Session::State::Cookie
25 Authentication::Store::Minimal
26 Authentication::Credential::Password
32 use Digest::MD5 qw/md5/;
37 my ( $self, $c ) = @_;
39 ok(!$c->sessionid, "no session id yet");
40 ok(!$c->user, "no user yet");
41 ok($c->login( "foo", "s3cr3t" ), "can login with clear");
42 is( $c->user, $users->{foo}, "user object is in proper place");
46 my ( $self, $c ) = @_;
48 ok( $c->sessionid, "session ID was restored" );
49 ok( $c->user, "a user was also restored");
50 is_deeply( $c->user, $users->{foo}, "restored user is the right one (deep test - store might change identity)" );
52 $c->delete_session("bah");
55 sub fluffy_bunny : Local {
56 my ( $self, $c ) = @_;
58 ok( !$c->sessionid, "no session ID was restored");
59 ok( !$c->user, "no user was restored");
62 __PACKAGE__->config->{authentication}{users} = $users = {
71 use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/; # for the cookie support
73 my $m = Test::WWW::Mechanize::Catalyst->new;
75 $m->get_ok("http://localhost/moose", "get ok");
76 $m->get_ok("http://localhost/elk", "get ok");
77 $m->get_ok("http://localhost/fluffy_bunny", "get ok");