Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test enable-plain-email=0 where it changes output
No test set it, though it switches the patch to a format of cgit's own
and drops the address from the feed and the trailer idents.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0109-patch.sh | 10 | |
| -rwxr-xr-x | tests/t0111-atom.sh | 8 | |
| -rwxr-xr-x | tests/t0206-trailers.sh | 10 |
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/t0109-patch.sh b/tests/t0109-patch.sh index 6aae556..88e94ae 100755 --- a/tests/t0109-patch.sh +++ b/tests/t0109-patch.sh @@ -70,6 +70,16 @@ test_expect_success 'the signature names the version when asked to' ' check_cgit_signature "$CGIT_VERSION" ' +# Without plain email the patch is written from a format of cgit's own, whose +# From line carries the name alone. +test_expect_success 'enable-plain-email=0 leaves the address off the patch' ' + cgitrc_copy plainrc enable-plain-email=0 && + cgit_ok plainrc "url=foo/patch" >tmp && + grep "^From: A U Thor$" tmp && + grep "^Subject: commit 5$" tmp && + ! grep "author@example.com" tmp +' + # The old name of a file renamed in the commit joins the limit, so the patch # carries the rename rather than a file added whole. test_expect_success 'a renamed file is patched as the rename' ' diff --git a/tests/t0111-atom.sh b/tests/t0111-atom.sh index 6d3e2c6..568fea4 100755 --- a/tests/t0111-atom.sh +++ b/tests/t0111-atom.sh @@ -57,6 +57,14 @@ test_expect_success 'a path with pathspec magic is refused' ' grep "^Status: 200" tmp ' +test_expect_success 'enable-plain-email=0 leaves the address out of the feed' ' + cgitrc_copy plainrc enable-plain-email=0 && + cgit_ok plainrc "url=foo/atom" >tmp && + grep "<name>A U Thor</name>" tmp && + ! grep "<email>" tmp && + ! grep "author@example.com" tmp +' + test_expect_success 'the feed link encodes the repository and the branch' ' cgitrc_copy feedrc && CGIT_CONFIG="$PWD/feedrc" HTTP_HOST=example.org QUERY_STRING="url=foo%2Bbar/log/&h=1%2B2" cgit >tmp && diff --git a/tests/t0206-trailers.sh b/tests/t0206-trailers.sh index 15c3600..70f10bd 100755 --- a/tests/t0206-trailers.sh +++ b/tests/t0206-trailers.sh @@ -78,6 +78,16 @@ test_expect_success 'the escaped value is what the filter sees' ' grep "<tr><th scope=.row.>Link</th><td>Link commit HTTPS://EXAMPLE.COM/?A=1&B=2</td></tr>" tmp ' +# The dump filter is handed the address whatever the setting, so the page is +# drawn without it here. +test_expect_success 'enable-plain-email=0 leaves the addresses off the idents' ' + cgitrc_repo plainrc trailers enable-commit-trailers=1 enable-plain-email=0 && + cgit_ok plainrc "url=trailers/commit/" >tmp && + grep "<tr><th scope=.row.>Signed-off-by</th><td>Mapped Name<br>C O Mitter</td></tr>" tmp && + grep "<tr><th scope=.row.>Acked-by</th><td>Some One (maintainer)</td></tr>" tmp && + ! grep "@example.com" tmp +' + test_expect_success 'a message with no block gets no table' ' plain=$(git -C repos/trailers rev-parse HEAD~1) && cgit_url "trailers/commit/&id=$plain" >tmp && |
