__PACKAGE__->config(
default => 'text/html',
map => {
- 'text/html' => [qw/ View Default /],
'application/json' => [qw/ JSON /],
+ map { $_ => [qw/ View Default /] }
+ qw( text/css text/html text/plain
+ application/atom+xml application/rss+xml
+ application/rss application/xml )
+
}
);
lazy_build => 1 );
method BUILD {
- $self->$_() for qw/last_change owner description references/; # Ensure to build early.
+ $self->$_() for qw/last_change owner description /; # Ensure to build early.
}
## Public methods
<modified>[% updated %]</modified>
[% FOREACH Commit = Commits %]
<entry>
- <title>[% Commit.title | html_entity %]</title>
+ <title>[% Commit.title | xml %]</title>
<id>[% Commit.id %]</id>
<link rel="alternate" type="text/html" href="[% Commit.id %]" />
<content type="xhtml">
BEGIN { do "$FindBin::Bin/../script/env" or die $@ }
use lib "$Bin/lib";
use TestGitalist;
+use HTTP::Request::Common;
-my $res = request('/repo1/atom');
+my $res = request(GET 'http://localhost/repo1/atom', 'Content-Type' => 'application/atom+xml');
ok $res->is_success;
is $res->content_type, 'application/atom+xml';
TODO: {
'is_bare' => 1,
'__CLASS__' => 'Gitalist::Git::Repository',
'last_change' => '2009-11-12T19:00:34Z',
- 'references' => {
- '0710a7c8ee11c73e8098d08f9384c2a839c65e4e' => [
- 'heads/branch1'
- ],
- '36c6c6708b8360d7023e8a1649c45bcf9b3bd818' => [
- 'heads/master',
- 'tags/0.01'
- ]
- },
'name' => 'repo1',
'description' => 'some test repository'
};
BEGIN { do "$FindBin::Bin/../script/env" or die $@ }
use lib "$Bin/lib";
use TestGitalist;
+use HTTP::Request::Common;
+
+my $res = request(GET 'http://localhost/opml', 'Content-Type' => 'application/rss');
-my $res = request('/opml');
ok $res->is_success;
is $res->content_type, 'application/rss';
BEGIN { do "$FindBin::Bin/../script/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};