Diff options
Diffstat (limited to 'tests/t0102-summary.sh')
-rwxr-xr-xtests/t0102-summary.sh20
1 file changed, 7 insertions, 13 deletions
diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh
index 9b47cc2..9e0e14c 100755
--- a/tests/t0102-summary.sh
+++ b/tests/t0102-summary.sh
@@ -33,14 +33,8 @@ test_expect_success 'a git clone url row falls back to the page url' '
'
test_expect_success 'an scp clone url row links to the http url' '
- {
- echo "virtual-root=/" &&
- echo "cache-size=0" &&
- echo "repo.url=foo" &&
- echo "repo.path=$PWD/repos/foo/.git" &&
- echo "repo.clone-url=git@example.org:foo https://example.org/foo"
- } >clonerc &&
- CGIT_CONFIG="$PWD/clonerc" QUERY_STRING="url=foo" cgit >tmp &&
+ cgitrc_repo clonerc foo "repo.clone-url=git@example.org:foo https://example.org/foo" &&
+ cgit_rc clonerc "url=foo" >tmp &&
grep "title=.foo Git repository. href=.https://example.org/foo.>git@example.org:foo</a>" tmp &&
grep "vcs-git. href=.https://example.org/foo." tmp &&
! grep "vcs-git. href=.git@" tmp
@@ -64,13 +58,13 @@ test_expect_success 'an empty clone url draws no clone heading' '
echo "repo.url=cloned" &&
echo "repo.path=$PWD/repos/empty.git"
} >emptyrc &&
- CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=foo" cgit >tmp &&
+ cgit_rc emptyrc "url=foo" >tmp &&
grep "commit 1" tmp &&
! grep "Clone</th>" tmp &&
- CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=empty" cgit >tmp &&
+ cgit_rc emptyrc "url=empty" >tmp &&
grep "Repository seems to be empty" tmp &&
! grep "Clone</th>" tmp &&
- CGIT_CONFIG="$PWD/emptyrc" QUERY_STRING="url=cloned" cgit >tmp &&
+ cgit_rc emptyrc "url=cloned" >tmp &&
grep "Clone</th>" tmp &&
grep "https://example.org/cloned</a>" tmp
'
@@ -98,7 +92,7 @@ row_widths() {
# Fails unless every row of the list table at the url is as many columns wide
# as the second argument says. A third names a config other than colsrc.
test_widths() {
- CGIT_CONFIG="$PWD/${3:-colsrc}" QUERY_STRING="url=$1" cgit >tmp &&
+ cgit_rc "${3:-colsrc}" "url=$1" >tmp &&
row_widths tmp | sort -u >actual &&
echo "$2" >expect &&
test_cmp expect actual
@@ -132,7 +126,7 @@ test_expect_success 'set up a repo cut short in every section' '
echo "repo.enable-log-filecount=1" &&
echo "repo.enable-log-linecount=1"
} >colsrc &&
- CGIT_CONFIG="$PWD/colsrc" QUERY_STRING="url=none" cgit >tmp &&
+ cgit_rc colsrc "url=none" >tmp &&
grep "<tbody class=.tags.>" tmp &&
grep "<tbody class=.clone.>" tmp &&
test $(grep -c ">\[...\]</a>" tmp) = 3