restructured dirs. need to write test to test how helper is invoked. also need to...
[catagits/Catalyst-Devel.git] / share / t / comptest.tt
diff --git a/share/t/comptest.tt b/share/t/comptest.tt
new file mode 100644 (file)
index 0000000..dd2c5e6
--- /dev/null
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+[% IF long_type == 'Controller' %][% IF mech %]use Test::More;
+
+eval "use Test::WWW::Mechanize::Catalyst '[% app %]'";
+plan $@
+    ? ( skip_all => 'Test::WWW::Mechanize::Catalyst required' )
+    : ( tests => 2 );
+
+ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
+
+$mech->get_ok( 'http://localhost[% uri %]' );
+[% ELSE %]use Test::More tests => 3;
+
+BEGIN { use_ok 'Catalyst::Test', '[% app %]' }
+BEGIN { use_ok '[% class %]' }
+
+ok( request('[% uri %]')->is_success, 'Request should succeed' );
+[% END %]
+[% ELSE %]use Test::More tests => 1;
+
+BEGIN { use_ok '[% class %]' }
+[% END %]