Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test what blame says for paths it cannot blame
Diffstat (limited to 'tests/t0104-tree.sh')
| -rwxr-xr-x | tests/t0104-tree.sh | 12 |
1 file changed, 12 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 2f77b97..607065b 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -342,6 +342,18 @@ test_expect_success 'a listing offers blame only where it works' ' test_grep ! "href=./bin/blame/big.bin.>blame</a>" tmp ' +# The bin and nested repositories are the ones the tests above built. +test_expect_success 'blame says why it cannot blame a path' ' + cgit_ok binblamerc "url=bin/blame/blob.bin" >tmp && + test_grep "<div class=.error.>Blob is binary</div>" tmp && + cgit_rc nestedrc "url=nested/blame/a" >tmp && + test_grep "^Status: 404" tmp && + test_grep "<div class=.error.>Blame is not available for a directory</div>" tmp && + cgit_rc nestedrc "url=nested/blame/a/no-such-file" >tmp && + test_grep "^Status: 404" tmp && + test_grep "<div class=.error.>Not found</div>" tmp +' + test_expect_success 'the file view offers blame only for a text file' ' cgit_ok binblamerc "url=bin/tree/small.txt" >tmp && test_grep "(<a href=./bin/plain/small.txt.>plain</a>) (<a href=./bin/blame/small.txt.>blame</a>)</div>" tmp && |
