3f718cfe1b8a514dc3155c045085482bc3b58876
[catagits/Catalyst-Plugin-Authentication.git] / t / live_app_session.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 BEGIN {
7         eval { require Test::WWW::Mechanize::Catalyst; require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
8         plan skip_all => "This test needs Test::WWW::Mechanize::Catalyst, Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed" if $@;
9     plan skip_all => "This test needs Test::WWW::Mechanize::Catalyst >= 0.50, you have only $Test::WWW::Mechanize::Catalyst::VERSION"
10         unless $Test::WWW::Mechanize::Catalyst::VERSION >= 0.50;
11     # There is something fishy going on here. When you run this from make test,
12     # there are 29 tests, when you run it from prove, there are 26 - WTF FIXME (t0m)
13     plan tests => 29;
14 }
15
16 use lib 't/lib';
17 use Test::WWW::Mechanize::Catalyst qw/AuthSessionTestApp/; # for the cookie support
18
19 my $m = Test::WWW::Mechanize::Catalyst->new;
20
21 $m->get_ok("http://localhost/moose", "get ok");
22 $m->get_ok("http://localhost/elk", "get ok");
23
24 $m->get("http://localhost/yak");
25 ok(!$m->success, 'Not ok, user unable to be resotred == nasal demons');
26
27 $m->get_ok("http://localhost/goat", "get ok");
28 $m->get_ok("http://localhost/fluffy_bunny", "get ok");
29 $m->get_ok("http://localhost/possum", "get ok");
30 $m->get_ok("http://localhost/butterfly", "get ok");
31