Merge branch 'master' of ssh://git.shadowcat.co.uk/Catalyst-Controller-MovableType
[catagits/Catalyst-Controller-MovableType.git] / t / live-test.t
diff --git a/t/live-test.t b/t/live-test.t
new file mode 100644 (file)
index 0000000..6dcbfb6
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More;
+
+# setup library path
+use FindBin qw($Bin);
+use lib "$Bin/lib";
+
+# make sure testapp works
+use ok 'TestApp';
+
+# a live test against TestApp, the test application
+use Test::WWW::Mechanize::Catalyst 'TestApp';
+my $mech = Test::WWW::Mechanize::Catalyst->new;
+$mech->get_ok('http://localhost/', 'get main page');
+$mech->content_like(qr/it works/i, 'see if it has our text');
+
+foreach my $script_name qw( mt-add-notify.cgi
+                            mt-atom.cgi
+                            mt.cgi
+                            mt-comments.cgi
+                            mt-feed.cgi
+                            mt-ftsearch.cgi
+                            mt-search.cgi
+                            mt-tb.cgi
+                            mt-testbg.cgi
+                            mt-upgrade.cgi
+                            mt-wizard.cgi
+                            mt-xmlrpc.cgi
+                            ) {
+                            # mt-config.cgi intentionally left out
+    my $mech = Test::WWW::Mechanize::Catalyst->new;
+    $mech->get_ok('http://localhost/mt/'.$script_name, 'get '.$script_name.' cgi');
+    $mech->content_like(qr/This is $script_name/, 'cgi script properly executed through Catalyst');
+}
+
+# TODO: test for mt-check.cgi to only work in $c->debug mode.
+
+done_testing;