6 use Test::More tests => 4;
13 Authentication::Store::Minimal
14 Authentication::Credential::HTTP
20 use Digest::MD5 qw/md5/;
25 my ( $self, $c ) = @_;
27 $c->authorization_required;
29 $c->res->body( $c->user->id );
32 __PACKAGE__->config->{authentication}{users} = $users = {
37 crypted_password => crypt("s3cr3t", "x8"),
40 hashed_password => md5("s3cr3t"),
41 hash_algorithm => "MD5",
49 use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/;
51 my $mech = Test::WWW::Mechanize::Catalyst->new;
53 $mech->get("http://localhost/moose");
54 is( $mech->status, 401, "status is 401");
56 $mech->content_lacks("foo", "no output");
58 my $r = HTTP::Request->new( GET => "http://localhost/moose" );
59 $r->authorization_basic(qw/foo s3cr3t/);
62 is( $mech->status, 200, "status is 200");
63 $mech->content_contains("foo", "foo output");