Fix RSS and atom feeds
Tomas Doran [Tue, 26 Jan 2010 01:38:47 +0000 (01:38 +0000)]
lib/Gitalist/Controller/Repository.pm
t/atom.t
t/rss.t

index 53cf1a9..c80f177 100644 (file)
@@ -81,7 +81,7 @@ sub atom : Chained('find') Args(0) {
   for my $commit ($repository->list_revs(%logargs)) {
     my $entry = XML::Atom::Entry->new;
     $entry->title( $mk_title->($commit->comment) );
-    $entry->id($c->uri_for_action('/commit/commit', [$repository->name, $commit->sha1]));
+    $entry->id($c->uri_for_action('/ref/commit', [$repository->name, $commit->sha1]));
     # XXX FIXME Needs work ...
     $entry->content($commit->comment);
     $feed->add_entry($entry);
@@ -122,7 +122,7 @@ sub rss : Chained('find') Args(0) {
     # XXX FIXME Needs work ....
     $rss->add_item(
         title       => $mk_title->($commit->comment),
-        permaLink   => $c->uri_for_action('/commit/commit', [$repository->name, $commit->sha1]),
+        permaLink   => $c->uri_for_action('/ref/commit', [$repository->name, $commit->sha1]),
         description => $commit->comment,
     );
   }
index 1d7abc2..726a9c5 100644 (file)
--- a/t/atom.t
+++ b/t/atom.t
@@ -12,7 +12,7 @@ TODO: {
     like $res->content, qr{description>some test repository</description};
 }
 like $res->content, qr{add dir1/file2</div};
-like $res->content, qr{<id>http://localhost/repo1/36c6c6708b8360d7023e8a1649c45bcf9b3bd818</id};
+like $res->content, qr{<id>http://localhost/repo1/36c6c6708b8360d7023e8a1649c45bcf9b3bd818/commit</id};
 like $res->content, qr{title>add dir1/file2</title};
 
 done_testing;
diff --git a/t/rss.t b/t/rss.t
index ec87a51..47f4c8d 100644 (file)
--- a/t/rss.t
+++ b/t/rss.t
@@ -10,6 +10,6 @@ like $res->content, qr{link>http://localhost/repo1</link};
 like $res->content, qr{description>some test repository</description};
 like $res->content, qr{title>add dir1/file2</title};
 like $res->content, qr{description>add dir1/file2</description};
-like $res->content, qr{guid isPermaLink="true">http://localhost/repo1/36c6c6708b8360d7023e8a1649c45bcf9b3bd818</guid};
+like $res->content, qr{guid isPermaLink="true">http://localhost/repo1/36c6c6708b8360d7023e8a1649c45bcf9b3bd818/commit</guid};
 
 done_testing;