Fix tests dying in absence of bootstrap scripts.
[catagits/Gitalist.git] / t / rss.t
diff --git a/t/rss.t b/t/rss.t
index c9c3804..98a7faa 100644 (file)
--- a/t/rss.t
+++ b/t/rss.t
@@ -1,10 +1,17 @@
 #!/usr/bin/env perl
 use FindBin qw/$Bin/;
-BEGIN { do "$FindBin::Bin/../script/env" or die $@ }
+BEGIN {
+    my $env = "$FindBin::Bin/script/env";
+    if (-r $env) {
+        do $env or die $@;
+    }
+}
+
 use lib "$Bin/lib";
 use TestGitalist;
+use HTTP::Request::Common;
 
-my $res = request('/repo1/rss');
+my $res = request(GET 'http://localhost/repo1/rss', 'Content-Type' => 'application/rss+xml');
 ok $res->is_success;
 is $res->content_type, 'application/rss+xml';
 like $res->content, qr{link>http://localhost/repo1</link};