Make history a fragment properly. It's not working, but doesn't explode any more
[catagits/Gitalist.git] / t / 01app.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More;
5 use FindBin qw/$Bin/;
6 use lib "$Bin/lib";
7
8 BEGIN {
9     $ENV{GITALIST_CONFIG} = $Bin;
10     $ENV{GITALIST_REPO_DIR} = '';
11     use_ok 'Catalyst::Test', 'Gitalist';
12 }
13 use TestGitalist;
14
15 for my $p ('', qw{
16     repo1 nodescription bare.git opml search
17     fragment/collectionofrepositories
18 }) {
19     my $path = '/' . $p;
20     ok( request($path)->is_success, "$path should succeed");
21 }
22
23 my $response = request('/DoesNotExist');
24 is $response->code, 404, 'invalid repository 404s';
25 like $response->content, qr/Page not found/, 'invalid repository handled correctly';
26 {
27   # URI tests for repo1
28   local *test = curry_test_uri('fragment/repo1');
29   test('');
30   test('shortlog');
31   test('log');
32   test('reflog');
33   test('heads');
34   test('tags');
35   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
36   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree');
37   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree/dir1');
38   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff');
39   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff/plain');
40   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/shortlog/dir1');
41   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1');
42   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1');
43   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1');
44   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1');
45 }
46
47 {
48   # URI tests for repo1
49   local *test = curry_test_uri('repo1');
50   test('');
51   test('search');
52   test('shortlog');
53   test('log');
54   test('reflog');
55   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
56   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree');
57   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff');
58   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch');
59   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1');
60   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2');
61   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1');
62   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1');
63   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1');
64   test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1');
65
66   TODO: {
67       local $TODO = "FIXME";
68       test('search', 'type=commit&text=added');
69
70       # FIXME - What's the difference here?
71       #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
72       #test('patch', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
73       #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e');
74       #test('patches', 'h=3f7567c7bdf7e7ebf410926493b92d398333116e;hp=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');
75   }
76 }
77
78 done_testing;