Diff options
Diffstat (limited to '')
-rwxr-xr-xtests/t0111-atom.sh23
1 file changed, 9 insertions, 14 deletions
diff --git a/tests/t0111-atom.sh b/tests/t0111-atom.sh
index 48448ef..608ab78 100755
--- a/tests/t0111-atom.sh
+++ b/tests/t0111-atom.sh
@@ -34,24 +34,13 @@ test_expect_success 'ten entries is the default ceiling' '
'
test_expect_success 'max-atom-items overrides the ceiling' '
- {
- echo "virtual-root=/" &&
- echo "cache-size=0" &&
- echo "max-atom-items=3" &&
- echo "repo.url=bar" &&
- echo "repo.path=$PWD/repos/bar/.git"
- } >atomrc &&
- CGIT_CONFIG="$PWD/atomrc" QUERY_STRING="url=bar/atom" cgit >tmp &&
+ cgitrc_repo atomrc bar max-atom-items=3 &&
+ cgit_rc atomrc "url=bar/atom" >tmp &&
strip_headers <tmp >feed &&
test $(grep -c "<entry>" feed) -eq 3
'
-if command -v xmllint >/dev/null 2>&1
-then
- test_set_prereq XMLLINT
-else
- say 'Skipping well-formedness check: xmllint not found'
-fi
+test_lazy_prereq XMLLINT 'command -v xmllint'
test_expect_success XMLLINT 'the feed is well-formed xml' '
cgit_url "foo/atom" >tmp &&
@@ -68,4 +57,10 @@ test_expect_success 'a path with pathspec magic is refused' '
grep "^Status: 200" 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 &&
+ grep "title=.Atom feed. href=.http://example.org/foo%2Bbar/atom/?h=1%2B2." tmp
+'
+
test_done