Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Follow the blame page's crumb and previous links
Both fixes were for links that led to a 404, and the tests read the
href without asking for the page it names.
Diffstat (limited to 'tests/t0104-tree.sh')
| -rwxr-xr-x | tests/t0104-tree.sh | 11 |
1 file changed, 9 insertions, 2 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 607065b..5df20b2 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -110,7 +110,11 @@ test_expect_success 'the folder crumbs of a blame page lead to the tree' ' ) && cgitrc_repo nestedrc nested enable-blame=1 && cgit_ok nestedrc "url=nested/blame/a/b/file.txt" >tmp && - grep "path: <a href=./nested/tree/.>root</a>/<a href=./nested/tree/a.>a</a>/<a href=./nested/tree/a/b.>b</a>/<a href=./nested/blame/a/b/file.txt.>file.txt</a>" tmp + grep "path: <a href=./nested/tree/.>root</a>/<a href=./nested/tree/a.>a</a>/<a href=./nested/tree/a/b.>b</a>/<a href=./nested/blame/a/b/file.txt.>file.txt</a>" tmp && + cgit_ok nestedrc "url=nested/tree/a" >tmp && + test_grep "href=./nested/tree/a/b.>b</a>" tmp && + cgit_ok nestedrc "url=nested/tree/a/b" >tmp && + test_grep "href=./nested/tree/a/b/file.txt.>file.txt</a>" tmp ' # A commit's lines link to the file as the parent had it, under the name it @@ -131,7 +135,10 @@ test_expect_success 'blame links a commit to the file before it' ' cgit_ok renamedrc "url=renamed/blame/b.txt" >tmp && added=$(git -C repos/renamed rev-parse HEAD~1) && grep "title=.Blame the previous revision. href=./renamed/blame/a.txt?id=$added.>^</a>" tmp && - test $(grep -c "Blame the previous revision" tmp) = 1 + test $(grep -c "Blame the previous revision" tmp) = 1 && + cgit_ok renamedrc "url=renamed/blame/a.txt&id=$added" >tmp && + test_grep "<a href=./renamed/plain/a.txt?id=$added.>plain</a>" tmp && + test_grep "<table class=.blame blob.>" tmp ' test_expect_success 'generate foo+bar/tree' 'cgit_ok_url "foo%2bbar/tree" >tmp' |
