Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test the switcher on a page pinned to a commit
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0103-log.sh | 12 |
1 file changed, 12 insertions, 0 deletions
diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh index 16fc6e9..8cab0f5 100755 --- a/tests/t0103-log.sh +++ b/tests/t0103-log.sh @@ -50,6 +50,18 @@ test_expect_success 'a branch head keeps its plain option' ' test_grep ! "detached" tmp ' +# A page pinned to a commit by id lists that commit in the switcher, selected +# in place of the branch it was reached from. +test_expect_success 'a pinned commit is selected in place of its branch' ' + sha=$(git -C repos/foo rev-parse master~1) && + cgit_ok_url "foo/commit&id=$sha" >tmp && + selected_options tmp >selected && + test_line_count = 1 selected && + short=$(echo "$sha" | cut -c1-10) && + test_grep "option value=.$sha. selected>$short (detached)<" selected && + test_grep "<option value=.master.>master</option>" tmp +' + test_expect_success 'a search escapes the space in its links' ' cgit_ok_url "with+space/log&qt=grep&q=commit+1" >tmp && test_grep "/with%20space/log/?qt=grep" tmp && |
