Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test the blame link in the file view's header
| -rwxr-xr-x | tests/t0104-tree.sh | 8 |
1 file changed, 8 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index ea1f15e..03fd9be 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -336,6 +336,14 @@ test_expect_success 'a listing offers blame only where it works' ' test_grep ! "href=./bin/blame/big.bin.>blame</a>" 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 && + cgit_ok binblamerc "url=bin/tree/blob.bin" >tmp && + test_grep "(<a href=./bin/plain/blob.bin.>plain</a>)</div>" tmp && + test_grep ! ">blame</a>" tmp +' + # The listing sniffs only the window git judges binary by, while blame and # the file view look for a NUL anywhere, so a file whose NUL lies past that # window is offered a blame link that ends on the binary notice. Reading the |
