only import Test::Exception where it is needed
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppCompat / Controller / Root.pm
CommitLineData
d055ce0c 1package AuthRealmTestAppCompat::Controller::Root;
2use warnings;
3use strict;
4use base qw/Catalyst::Controller/;
5
6__PACKAGE__->config( namespace => '' );
7
8use Test::More;
d055ce0c 9
10sub moose : Local {
fb90f091 11 my ( $self, $c ) = @_;
d055ce0c 12
13 while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {
14
15 my $ok = eval {
16 $c->authenticate(
17 { username => $user, password => $info->{password} },
18 'members'
19 ),
20 };
21
22 ok( !$@, "Test did not die: $@" );
23 ok( $ok, "user $user authentication" );
24 }
25
fb90f091 26 $c->res->body( "ok" );
d055ce0c 27}
28
291;
30