X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fjson_view.t;h=b32a0a62ae64048fb74656f73c66408db003aba6;hb=cce03a80183c94b16b411533e3744f9d03625634;hp=026479ddc328ac154b523b8364951a6d2a865461;hpb=d9f49e9dbe7ea23f576155d46b3c8c77539cc1ee;p=catagits%2FGitalist.git diff --git a/t/json_view.t b/t/json_view.t index 026479d..b32a0a6 100644 --- a/t/json_view.t +++ b/t/json_view.t @@ -1,11 +1,15 @@ #!/usr/bin/env perl + +use FindBin qw/$Bin/; +BEGIN { do "$FindBin::Bin/../script/env" or die $@ } + use strict; use warnings; use Test::More; use HTTP::Request::Common; -use FindBin qw/$Bin/; use JSON::Any; + BEGIN { $ENV{GITALIST_CONFIG} = $Bin; $ENV{GITALIST_REPO_DIR} = ''; @@ -14,12 +18,13 @@ BEGIN { my $j = JSON::Any->new; -my $res = request(GET 'http://localhost/summary?p=repo1', 'Content-Type' => 'application/json'); +my $res = request(GET 'http://localhost/repo1', 'Content-Type' => 'application/json'); is $res->code, 200; my $data = $j->decode($res->content); is ref($data), 'HASH'; +delete $data->{owner} + if $data && exists $data->{owner}; is_deeply $data, { - 'owner' => 'Tomas Doran', 'is_bare' => 1, '__CLASS__' => 'Gitalist::Git::Repository', 'last_change' => '2009-11-12T19:00:34Z', @@ -28,7 +33,8 @@ is_deeply $data, { 'heads/branch1' ], '36c6c6708b8360d7023e8a1649c45bcf9b3bd818' => [ - 'heads/master' + 'heads/master', + 'tags/0.01' ] }, 'name' => 'repo1',