4 BEGIN { do "$FindBin::Bin/../script/env" or die $@ }
9 use HTTP::Request::Common;
14 $ENV{GITALIST_CONFIG} = $Bin;
15 $ENV{GITALIST_REPO_DIR} = '';
16 use_ok 'Catalyst::Test', 'Gitalist';
19 my $j = JSON::Any->new;
21 my $res = request(GET 'http://localhost/repo1', 'Content-Type' => 'application/json');
23 my $data = $j->decode($res->content);
24 is ref($data), 'HASH';
26 if $data && exists $data->{owner};
29 '__CLASS__' => 'Gitalist::Git::Repository',
30 'last_change' => '2009-11-12T19:00:34Z',
32 'description' => 'some test repository'
35 $res = request(GET 'http://localhost/repo1/3f7567c7bdf7e7ebf410926493b92d398333116e/commit', 'Content-Type' => 'application/json');
37 $data = $j->decode($res->content);
38 is ref($data), 'HASH';
39 delete $data->{repository}{owner}
40 if $data && exists $data->{repository}{owner};
44 '__CLASS__' => 'Gitalist::Git::Repository',
45 'last_change' => '2009-11-12T19:00:34Z',
47 'description' => 'some test repository'
49 '__CLASS__' => 'Gitalist::Git::Object::Commit',
50 'sha1' => '3f7567c7bdf7e7ebf410926493b92d398333116e',
53 'modestr' => '----------',