From: Zachary Stevens Date: Sat, 7 Nov 2009 19:02:52 +0000 (+0000) Subject: Add a few URI tests against the test repository. X-Git-Tag: 0.000000_01~68^2~3^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2338f4f3142b64ccd1994ddb3565ee34b3b7a5f;p=catagits%2FGitalist.git Add a few URI tests against the test repository. --- diff --git a/t/01app.t b/t/01app.t index 0be3710..267e805 100644 --- a/t/01app.t +++ b/t/01app.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 2; +use Test::More qw/no_plan/; BEGIN { use_ok 'Catalyst::Test', 'Gitalist' } @@ -13,6 +13,35 @@ SKIP: { skip "Set APP_TEST for the tests to run fully", 1 if !$ENV{APP_TEST}; -ok( request('/')->is_success, 'Request should succeed' ); + ok( request('/')->is_success, 'Request should succeed' ); + + + # URI tests for repo1 + use Data::Dumper; + my $test_repo1 = curry_test_uri('repo1'); + &$test_repo1('/summary'); + &$test_repo1('/shortlog'); + &$test_repo1('/log'); + &$test_repo1('/commit'); + &$test_repo1('/commitdiff', 'h=36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); + &$test_repo1('/tree', 'h=145dc3ef5d307be84cb9b325d70bd08aeed0eceb;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); +# &$test_repo1('/', 'a=blob;f=file1'); } # Close APP_TEST skip + +sub test_uri { + my ($p, $uri, $qs) = @_; + $qs ||= ''; + my $request = "$uri?p=repo1;$qs"; + warn("request: $request"); + my $response = request($request); + ok($response->is_success, "ok $p - $uri"); +} + +sub curry_test_uri { + my $p = shift; + sub { + my $uri = shift; + test_uri($p, $uri); + }; +};