Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Answer an empty repository's feed with a feed
Diffstat (limited to 'tests/t0111-atom.sh')
| -rwxr-xr-x | tests/t0111-atom.sh | 19 |
1 file changed, 19 insertions, 0 deletions
diff --git a/tests/t0111-atom.sh b/tests/t0111-atom.sh index 608ab78..3040b79 100755 --- a/tests/t0111-atom.sh +++ b/tests/t0111-atom.sh @@ -63,4 +63,23 @@ test_expect_success 'the feed link encodes the repository and the branch' ' grep "title=.Atom feed. href=.http://example.org/foo%2Bbar/atom/?h=1%2B2." tmp ' +# A reader may subscribe before the first push, and the page every other view +# of an empty repository falls back to is no feed it can read. +test_expect_success 'an empty repository answers with a feed of no entries' ' + git init -q --bare repos/empty.git && + cgitrc_repo emptyrc empty "repo.path=$PWD/repos/empty.git" && + cgit_rc emptyrc "url=empty/atom" >tmp && + head -n 1 tmp | grep "Status: 200 OK" && + sed "/^$/q" tmp | grep "Content-Type: application/atom+xml" && + strip_headers <tmp >feed && + grep "<title>empty</title>" feed && + grep "<updated>" feed && + ! grep "<entry>" feed && + grep "</feed>" feed +' + +test_expect_success XMLLINT 'the empty feed is well-formed xml' ' + xmllint --noout feed +' + test_done |
