From: Tomas Doran Date: Mon, 18 Jan 2010 23:43:56 +0000 (+0000) Subject: Add testing to atom, fix RSS links X-Git-Tag: 0.000006_01~1^2~63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=commitdiff_plain;h=840edca5cc6b621336749fb04640c0abd515883f Add testing to atom, fix RSS links --- diff --git a/lib/Gitalist/Controller/Repository.pm b/lib/Gitalist/Controller/Repository.pm index 33e6f53..b3ed666 100644 --- a/lib/Gitalist/Controller/Repository.pm +++ b/lib/Gitalist/Controller/Repository.pm @@ -105,7 +105,7 @@ sub rss : Chained('find') Args(0) { my $rss = XML::RSS->new(version => '2.0'); $rss->channel( title => lc(Sys::Hostname::hostname()) . ' - ' . Gitalist->config->{name}, - link => $c->uri_for('summary', {p=>$repository->name}), + link => $c->uri_for_action('/repository/summary', [$repository->name]), language => 'en', description => $repository->description, pubDate => DateTime->now, diff --git a/t/01app.t b/t/01app.t index 256c2ed..42ff71e 100644 --- a/t/01app.t +++ b/t/01app.t @@ -10,9 +10,7 @@ BEGIN { use_ok 'Catalyst::Test', 'Gitalist'; } -ok( request('/')->is_success, 'Request should succeed' ); - -for my $p (qw/ repo1 nodescription bare.git opml /) { +for my $p ('', qw/ repo1 nodescription bare.git opml /) { my $path = '/' . $p; ok( request($path)->is_success, "$path should succeed"); } diff --git a/t/atom.t b/t/atom.t new file mode 100644 index 0000000..1964d2c --- /dev/null +++ b/t/atom.t @@ -0,0 +1,25 @@ +#!/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('/repo1/atom'); +ok $res->is_success; + +TODO: { + local $TODO = "Does not work yet. Need similar info to RSS feed"; + like $res->content, qr{link>http://localhost/repo1content, qr{description>some test repositorycontent, qr{add dir1/file2content, qr{http://localhost/repo1/36c6c6708b8360d7023e8a1649c45bcf9b3bd818content, qr{title>add dir1/file2