X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01app.t;h=2c2d9e5c7c4cf75d3cde653bc19d3dc8172be03d;hb=d8abdf1cd357564b8e9e7b2c766feb9990a941fb;hp=5ba43161b49d804d73610a4d150e57b62fd71b5b;hpb=5fd1f586b5dac064793abc4a45714a0ad8d9ec6d;p=catagits%2FGitalist.git diff --git a/t/01app.t b/t/01app.t index 5ba4316..2c2d9e5 100644 --- a/t/01app.t +++ b/t/01app.t @@ -10,10 +10,41 @@ BEGIN { } ok( request('/')->is_success, 'Request should succeed' ); -for my $p (qw/ bare.git repo1 nodescription /) { + +for my $p (qw/ repo1 nodescription /) { my $path = '/summary?p=' . $p; ok( request($path)->is_success, "$path should succeed"); } +is request('/summary?p=DoesNotExist')->code, 404, + '/summary?p=DoesNotExist 404s'; +{ + # URI tests for repo1 + local *test = curry_test_uri('repo1'); + test('/summary'); + test('/shortlog'); + test('/log'); + test('/reflog'); + test('/commit'); + test('/commitdiff', 'h=36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); + test('/tree', 'h=145dc3ef5d307be84cb9b325d70bd08aeed0eceb;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); + test('/search', 'h=36c6c6708b8360d7023e8a1649c45bcf9b3bd818&f=&type=commit&text=added'); +} + done_testing; +sub test_uri { + my ($p, $uri, $qs) = @_; + $qs ||= ''; + my $request = "$uri?p=repo1;$qs"; + my $response = request($request); + ok($response->is_success, "ok $p - $uri"); +} + +sub curry_test_uri { + my $p = shift; + sub { + my ($uri, $qs) = @_; + test_uri($p, $uri, $qs); + }; +};