Commit | Line | Data |
89de6a33 |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
a38862e5 |
4 | use Test::More; |
5 | use FindBin qw/$Bin/; |
6dac2638 |
6 | use lib "$Bin/lib"; |
89de6a33 |
7 | |
a38862e5 |
8 | BEGIN { |
9 | $ENV{GITALIST_CONFIG} = $Bin; |
eb7978f3 |
10 | $ENV{GITALIST_REPO_DIR} = ''; |
1819cb18 |
11 | use_ok 'Catalyst::Test', 'Gitalist'; |
a38862e5 |
12 | } |
6dac2638 |
13 | use TestGitalist; |
28e35997 |
14 | |
76476bb0 |
15 | for my $p ('', qw/ repo1 nodescription bare.git opml search /) { |
2a172f65 |
16 | my $path = '/' . $p; |
5fd1f586 |
17 | ok( request($path)->is_success, "$path should succeed"); |
18 | } |
28e35997 |
19 | |
2a172f65 |
20 | my $response = request('/DoesNotExist'); |
82bc0f05 |
21 | is $response->code, 404, 'invalid repository 404s'; |
22 | like $response->content, qr/Page not found/, 'invalid repository handled correctly'; |
b4439022 |
23 | |
b4439022 |
24 | |
f9466a6c |
25 | { |
f2338f4f |
26 | # URI tests for repo1 |
f9466a6c |
27 | local *test = curry_test_uri('repo1'); |
50df06b8 |
28 | test(''); |
76476bb0 |
29 | test('search'); |
50df06b8 |
30 | test('shortlog'); |
31 | test('log'); |
32 | test('reflog'); |
a349e797 |
33 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); |
34 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); |
35 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); |
36 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch'); |
37 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1'); |
38 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2'); |
ca06a177 |
39 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); |
40 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); |
41 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1'); |
42 | test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); |
43 | |
50df06b8 |
44 | TODO: { |
45 | local $TODO = "FIXME"; |
a349e797 |
46 | test('search', 'type=commit&text=added'); |
47 | |
a349e797 |
48 | # FIXME - What's the difference here? |
49 | #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e'); |
50 | #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac'); |
51 | #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e'); |
52 | #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac'); |
50df06b8 |
53 | } |
f9466a6c |
54 | } |
e8b87f6b |
55 | |
a38862e5 |
56 | done_testing; |