05cb3a05716de2c00174964dc0dee1aea4cdb77c
[catagits/Catalyst-Authentication-Credential-HTTP.git] / t / live_app.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use Test::More;
5 BEGIN {
6     eval { require Test::WWW::Mechanize::Catalyst }
7       or plan skip_all =>
8       "Test::WWW::Mechanize::Catalyst is needed for this test";
9     plan tests => 4;
10 }
11 use HTTP::Request;
12
13 use Test::More;
14 use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/;
15 my $mech = Test::WWW::Mechanize::Catalyst->new;
16 $mech->get("http://localhost/moose");
17 is( $mech->status, 401, "status is 401" ) or die $mech->content;
18 $mech->content_lacks( "foo", "no output" );
19 my $r = HTTP::Request->new( GET => "http://localhost/moose" );
20 $r->authorization_basic(qw/foo s3cr3t/);
21 $mech->request($r);
22 is( $mech->status, 200, "status is 200" );
23 $mech->content_contains( "foo", "foo output" );
24