File: 003_apptest.t

package info (click to toggle)
libcatalyst-authentication-credential-authen-simple-perl 0.09-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 228 kB
  • ctags: 26
  • sloc: perl: 305; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;

use Test::More;

plan tests => 35;

use lib 't/lib';

use Catalyst::Test qw/AuthTestApp3/;

cmp_ok(get("/authed_ok?username=bob&password=bob")       , 'eq', 'authed Bob Smith', "bob authed through stub");
cmp_ok(get("/authed_ok?username=bob&password=uniquepass"), 'eq', 'authed Bob Smith', "bob authed through onlyone");
cmp_ok(get("/authed_ok?username=john&password=john")       , 'eq', 'authed John Smith', "john authed through stub");
cmp_ok(get("/authed_ok?username=john&password=uniquepass"), 'eq', 'authed John Smith', "john authed through onlyone");

cmp_ok(get("/authed_ko?username=bob&password=xxx")       , 'eq', 'not authed', "bob not authed");
cmp_ok(get("/authed_ko?username=john&password=xxx")       , 'eq', 'not authed', "john not authed");
cmp_ok(get("/authed_ko?username=notuser&password=uniquepass"), 'eq', 'not authed', "unexistant user not authed");