9 eval { require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
10 plan skip_all => "This test needs Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed" if $@;
19 Session::State::Cookie
22 Authentication::Store::Minimal
23 Authentication::Credential::Password
29 use Digest::MD5 qw/md5/;
34 my ( $self, $c ) = @_;
36 ok(!$c->sessionid, "no session id yet");
37 ok(!$c->user, "no user yet");
38 ok($c->login( "foo", "s3cr3t" ), "can login with clear");
39 is( $c->user, $users->{foo}, "user object is in proper place");
43 my ( $self, $c ) = @_;
45 ok( $c->sessionid, "session ID was restored" );
46 ok( $c->user, "a user was also restored");
47 is_deeply( $c->user, $users->{foo}, "restored user is the right one (deep test - store might change identity)" );
49 $c->delete_session("bah");
52 sub fluffy_bunny : Local {
53 my ( $self, $c ) = @_;
55 ok( !$c->sessionid, "no session ID was restored");
56 ok( !$c->user, "no user was restored");
59 __PACKAGE__->config->{authentication}{users} = $users = {
68 use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/; # for the cookie support
70 my $m = Test::WWW::Mechanize::Catalyst->new;
72 $m->get_ok("http://localhost/moose", "get ok");
73 $m->get_ok("http://localhost/elk", "get ok");
74 $m->get_ok("http://localhost/fluffy_bunny", "get ok");