Commit | Line | Data |
d055ce0c |
1 | package AuthRealmTestAppProgressive::Controller::Root; |
2 | use warnings; |
3 | use strict; |
4 | use base qw/Catalyst::Controller/; |
5 | |
6 | __PACKAGE__->config(namespace => ''); |
7 | |
8 | use Test::More; |
d055ce0c |
9 | |
10 | sub progressive : Local { |
fb90f091 |
11 | my ( $self, $c ) = @_; |
d055ce0c |
12 | |
13 | foreach my $realm ( keys %AuthRealmTestAppProgressive::members ) { |
14 | while ( my ( $user, $info ) = each %{$AuthRealmTestAppProgressive::members{$realm}} ) { |
15 | my $ok = eval { |
16 | $c->authenticate( |
17 | { username => $user, password => $info->{password} }, |
18 | ); |
19 | }; |
20 | ok( !$@, "authentication passed." ); |
21 | ok( $ok, "user authenticated" ); |
22 | ok( $c->user_in_realm($realm), "user in proper realm" ); |
23 | } |
24 | } |
fb90f091 |
25 | $c->res->body( "ok" ); |
d055ce0c |
26 | } |
27 | |
28 | 1; |
29 | |