Diff options
Diffstat (limited to 'tests/t0101-index.sh')
-rwxr-xr-xtests/t0101-index.sh20
1 file changed, 6 insertions, 14 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh
index e50f0f8..c8b9fb7 100755
--- a/tests/t0101-index.sh
+++ b/tests/t0101-index.sh
@@ -22,23 +22,15 @@ test_expect_success 'no tree-link' '! grep "foo/tree" tmp'
test_expect_success 'no log-link' '! grep "foo/log" tmp'
test_expect_success 'index links lead to the summary, log and tree' '
- echo "enable-index-links=1" >links-cgitrc &&
- sed "s/^cache-size=.*/cache-size=0/" cgitrc >>links-cgitrc &&
- CGIT_CONFIG="$PWD/links-cgitrc" QUERY_STRING="url=" cgit >tmp &&
+ cgitrc_copy links-cgitrc enable-index-links=1 &&
+ cgit_rc links-cgitrc "url=" >tmp &&
grep ">summary</a><a class=.button. href=./foo/log/.>log</a>" tmp &&
grep "href=./foo/log/.>log</a><a class=.button. href=./foo/tree/.>tree<" tmp
'
test_expect_success 'each css and js entry gets a link of its own' '
- {
- echo "css=/a.css" &&
- echo "css=/b.css" &&
- echo "js=/a.js" &&
- echo "js=" &&
- echo "js=/b.js"
- } >headrc &&
- sed "s/^cache-size=.*/cache-size=0/" cgitrc >>headrc &&
- CGIT_CONFIG="$PWD/headrc" QUERY_STRING="url=" cgit >tmp &&
+ cgitrc_copy headrc css=/a.css css=/b.css js=/a.js js= js=/b.js &&
+ cgit_rc headrc "url=" >tmp &&
grep "<link rel=.stylesheet. href=./a.css.>" tmp &&
grep "<link rel=.stylesheet. href=./b.css.>" tmp &&
grep "<script src=" tmp >scripts &&
@@ -48,7 +40,7 @@ test_expect_success 'each css and js entry gets a link of its own' '
'
test_expect_success 'the feed link encodes the repository and the branch' '
- sed "s/^cache-size=.*/cache-size=0/" cgitrc >feedrc &&
+ 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
'
@@ -63,7 +55,7 @@ test_expect_success 'a cut description keeps whole characters' '
echo "repo.path=$PWD/repos/foo/.git" &&
echo "repo.desc=日本語の説明文です"
} >descrc &&
- CGIT_CONFIG="$PWD/descrc" QUERY_STRING="url=" cgit >tmp &&
+ cgit_rc descrc "url=" >tmp &&
grep ">日本語\.\.\.</a>" tmp
'