Add test for OPML page
Tomas Doran [Mon, 18 Jan 2010 23:29:57 +0000 (23:29 +0000)]
t/opml.t [new file with mode: 0644]

diff --git a/t/opml.t b/t/opml.t
new file mode 100644 (file)
index 0000000..ee94c85
--- /dev/null
+++ b/t/opml.t
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use FindBin qw/$Bin/;
+
+BEGIN {
+    $ENV{GITALIST_CONFIG} = $Bin;
+    $ENV{GITALIST_REPO_DIR} = '';
+    use_ok 'Catalyst::Test', 'Gitalist';
+}
+
+my $res = request('/opml');
+ok $res->is_success;
+
+like $res->content, qr{Gitalist</title>};
+like $res->content, qr{xmlUrl="http://localhost/bare.git/rss"};
+like $res->content, qr{text="repo1 - some test repository"};
+like $res->content, qr{xmlUrl="http://localhost/repo1/rss"};
+
+done_testing;