533a5ff80b402ba5b0df0ebfbfb51bea1ccc7e46
[catagits/Catalyst-Devel.git] / share / t / comptest.tt
1 use strict;
2 use warnings;
3 [% IF long_type == 'Controller' %][% IF mech %]use Test::More;
4
5 eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
6 if ($@) {
7     plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
8         exit 0;
9 }
10
11 ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
12
13 $mech->get_ok( 'http://localhost[% uri %]' );
14 [% ELSE %]use Test::More tests => 3;
15
16 BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
17 BEGIN { use_ok '[% class %]' }
18
19 ok( request('[% uri %]')->is_success, 'Request should succeed' );
20 [% END %]
21 [% ELSE %]use Test::More tests => 1;
22
23 BEGIN { use_ok '[% class %]' }
24 [% END %]
25
26 done_testing();