moved tests out and into t/lib/
[catagits/Catalyst-Authentication-Credential-HTTP.git] / t / live_app.t
CommitLineData
790f9ddb 1#!/usr/bin/perl
790f9ddb 2use strict;
3use warnings;
ed61ff6d 4use Test::More;
ed61ff6d 5BEGIN {
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}
790f9ddb 11use HTTP::Request;
861c2f44 12
13use Test::More;
790f9ddb 14use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/;
790f9ddb 15my $mech = Test::WWW::Mechanize::Catalyst->new;
790f9ddb 16$mech->get("http://localhost/moose");
513d8ab6 17is( $mech->status, 401, "status is 401" ) or die $mech->content;
ed61ff6d 18$mech->content_lacks( "foo", "no output" );
790f9ddb 19my $r = HTTP::Request->new( GET => "http://localhost/moose" );
20$r->authorization_basic(qw/foo s3cr3t/);
ed61ff6d 21$mech->request($r);
22is( $mech->status, 200, "status is 200" );
23$mech->content_contains( "foo", "foo output" );
513d8ab6 24