File: Root.pm

package info (click to toggle)
libcatalyst-plugin-authentication-perl 0.10023-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 604 kB
  • ctags: 307
  • sloc: perl: 3,672; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package AuthRealmTestAppCompat::Controller::Root;
use warnings;
use strict;
use base qw/Catalyst::Controller/;

__PACKAGE__->config( namespace => '' );

use Test::More;
use Test::Exception;

sub moose : Local {
    my ( $self, $c ) = @_;

    while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {

        my $ok = eval {
            $c->authenticate(
                { username => $user, password => $info->{password} },
                'members'
            ),
        };

        ok( !$@,                "Test did not die: $@" );
        ok( $ok,                "user $user authentication" );
    }

    $c->res->body( "ok" );
}

1;