#!/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 $env = "$FindBin::Bin/../script/env";
+ if (-r $env) {
+ do $env or die $@;
+ }
}
-my $res = request('/opml');
+use lib "$Bin/lib";
+use TestGitalist;
+use HTTP::Request::Common;
+
+my $res = request(GET 'http://localhost/opml', 'Content-Type' => 'application/rss');
+
ok $res->is_success;
+is $res->content_type, 'application/rss';
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"};