Diff options
-rwxr-xr-xtests/t0205-config.sh9
1 file changed, 6 insertions, 3 deletions
diff --git a/tests/t0205-config.sh b/tests/t0205-config.sh
index 4536e49..775e509 100755
--- a/tests/t0205-config.sh
+++ b/tests/t0205-config.sh
@@ -25,7 +25,8 @@ test_expect_success 'set up configs' '
echo "repo.desc=early" &&
echo "repo.url=diag" &&
echo "repo.path=$PWD/repos/foo/.git" &&
- echo "repo.about-filter=exec:/bin/true"
+ echo "repo.readme=:file-1" &&
+ echo "repo.about-filter=exec:true"
} >earlyrc
'
@@ -65,9 +66,11 @@ test_expect_success 'the flag lets a scanned repository set its filters' '
! grep "Ignoring" err
'
+# The filter prints nothing, so an empty about div shows that it ran in place
+# of the readme.
test_expect_success 'a repo filter in the main cgitrc needs no flag' '
- ! grep "about-filter" err &&
- CGIT_CONFIG="$PWD/earlyrc" QUERY_STRING="url=diag/" cgit >tmp 2>err &&
+ CGIT_CONFIG="$PWD/earlyrc" QUERY_STRING="url=diag/about/" cgit >tmp 2>err &&
+ grep "<div id=.about.></div>" tmp &&
! grep "about-filter" err
'