Commit | Line | Data |
ff817455 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | |
6 | BEGIN { |
fb90f091 |
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 $@; |
8f8ae3b4 |
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; |
ff817455 |
11 | } |
12 | |
a3bf437a |
13 | use lib 't/lib'; |
14 | use Test::WWW::Mechanize::Catalyst qw/AuthSessionTestApp/; # for the cookie support |
ff817455 |
15 | |
16 | my $m = Test::WWW::Mechanize::Catalyst->new; |
17 | |
18 | $m->get_ok("http://localhost/moose", "get ok"); |
19 | $m->get_ok("http://localhost/elk", "get ok"); |
eea5667a |
20 | |
21 | $m->get("http://localhost/yak"); |
22 | ok(!$m->success, 'Not ok, user unable to be resotred == nasal demons'); |
23 | |
d055ce0c |
24 | foreach my $type (qw/ goat fluffy_bunny possum butterfly /) { |
25 | $m->get_ok("http://localhost/$type", "get $type ok"); |
26 | } |
27 | |
28 | done_testing; |
8f8ae3b4 |
29 | |