Diff options
Diffstat (limited to 'tests/t0105-plain.sh')
| -rwxr-xr-x | tests/t0105-plain.sh | 16 |
1 file changed, 5 insertions, 11 deletions
diff --git a/tests/t0105-plain.sh b/tests/t0105-plain.sh index 4615dc5..6a96b61 100755 --- a/tests/t0105-plain.sh +++ b/tests/t0105-plain.sh @@ -65,9 +65,9 @@ test_expect_success 'only text and xml types carry a charset' ' echo "mimetype.svg=image/svg+xml" && cat cgitrc } >typesrc && - CGIT_CONFIG="$PWD/typesrc" QUERY_STRING="url=foo/plain/doc.docx" cgit >tmp && + cgit_rc typesrc "url=foo/plain/doc.docx" >tmp && sed "/^$/q" tmp | grep "^Content-Type: $docx$" && - CGIT_CONFIG="$PWD/typesrc" QUERY_STRING="url=foo/plain/pic.svg" cgit >tmp && + cgit_rc typesrc "url=foo/plain/pic.svg" >tmp && sed "/^$/q" tmp | grep "^Content-Type: image/svg+xml; charset=UTF-8$" ' @@ -83,14 +83,8 @@ test_expect_success 'plain answers once for duplicate tree entries' ' c=$(echo dup | git commit-tree $top) && git update-ref refs/heads/master $c ) && - { - echo "virtual-root=/" && - echo "cache-size=0" && - echo "mimetype.png=image/png" && - echo "repo.url=dup" && - echo "repo.path=$PWD/repos/dup/.git" - } >duprc && - CGIT_CONFIG="$PWD/duprc" QUERY_STRING="url=dup/plain/x.png" cgit >tmp && + cgitrc_repo duprc dup mimetype.png=image/png && + cgit_rc duprc "url=dup/plain/x.png" >tmp && test $(grep -c "^Status:" tmp) = 1 && test $(grep -c "^Content-Type:" tmp) = 1 && grep "^Content-Type: image/png" tmp @@ -106,7 +100,7 @@ test_expect_success 'a control character in a file name stays out of the headers c=$(echo ctl | git commit-tree $top) && git update-ref refs/heads/ctl $c ) && - CGIT_CONFIG="$PWD/duprc" QUERY_STRING="url=dup/plain/ctl%01name.txt&h=ctl" cgit >tmp && + cgit_rc duprc "url=dup/plain/ctl%01name.txt&h=ctl" >tmp && grep "^Content-Disposition: inline; filename=.ctl?name.txt.$" tmp ' |
