X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01app.t;h=56f8799d62ce4baa0396b1df83d4942ad332f9de;hb=ca5cfe83ce7641811fa4befb2905d1e62afbc845;hp=aea441c9b5f6069d27cb3fbc1a88aa6bf20deab7;hpb=76476bb0cf79bb947b7572df092f861593c3e2b5;p=catagits%2FGitalist.git diff --git a/t/01app.t b/t/01app.t index aea441c..56f8799 100644 --- a/t/01app.t +++ b/t/01app.t @@ -1,18 +1,19 @@ #!/usr/bin/env perl -use strict; -use warnings; -use Test::More; use FindBin qw/$Bin/; -use lib "$Bin/lib"; - BEGIN { - $ENV{GITALIST_CONFIG} = $Bin; - $ENV{GITALIST_REPO_DIR} = ''; - use_ok 'Catalyst::Test', 'Gitalist'; + my $env = "$FindBin::Bin/../script/env"; + if (-r $env) { + do $env or die $@; + } } + +use lib "$Bin/lib"; use TestGitalist; -for my $p ('', qw/ repo1 nodescription bare.git opml search /) { +for my $p ('', qw{ + repo1 nodescription bare.git opml search + fragment/collectionofrepositories +}) { my $path = '/' . $p; ok( request($path)->is_success, "$path should succeed"); } @@ -21,25 +22,33 @@ my $response = request('/DoesNotExist'); is $response->code, 404, 'invalid repository 404s'; like $response->content, qr/Page not found/, 'invalid repository handled correctly'; +# URI tests for repo1 +foreach my $test (map {curry_test_uri($_)} ('fragment/repo1', 'repo1') ) { + $test->(''); + $test->('shortlog'); + $test->('log'); + $test->('heads'); + $test->('tags'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff/plain'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); +} { # URI tests for repo1 local *test = curry_test_uri('repo1'); - test(''); test('search'); - test('shortlog'); - test('log'); - test('reflog'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); + test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); TODO: { local $TODO = "FIXME";