1 package AuthRealmTestAppProgressive;
5 ### using A::Store::minimal with new style realms
6 ### makes the app blow up, since c::p::a::s::minimal
7 ### isa c:a::s::minimal, and it's compat setup() gets
8 ### run, with an unexpected config has (realms on top,
9 ### not users). This tests makes sure the app no longer
10 ### blows up when this happens.
13 Authentication::Store::Minimal
21 bob => { password => "s00p3r" }
24 sally => { password => "s00p3r" }
28 __PACKAGE__->config->{'Plugin::Authentication'} = {
29 default_realm => 'progressive',
31 class => 'Progressive',
32 realms => [ 'other', 'members' ],
37 password_field => 'password',
38 password_type => 'clear'
42 users => $members{other},
48 password_field => 'password',
49 password_type => 'clear'
53 users => $members{members},
58 sub progressive : Local {
59 my ( $self, $c ) = @_;
61 foreach my $realm ( keys %members ) {
62 while ( my ( $user, $info ) = each %{$members{$realm}} ) {
65 { username => $user, password => $info->{password} },
68 ok( !$@, "authentication passed." );
69 ok( $ok, "user authenticated" );
70 ok( $c->user_in_realm($realm), "user in proper realm" );
73 $c->res->body( "ok" );