diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Add a help page with common workflows
Diffstat (limited to '')
-rw-r--r--tests/t0200-security.sh25
1 file changed, 25 insertions, 0 deletions
diff --git a/tests/t0200-security.sh b/tests/t0200-security.sh
index d3ac472..44703c9 100644
--- a/tests/t0200-security.sh
+++ b/tests/t0200-security.sh
@@ -124,4 +124,29 @@ test_expect_success 'tree groups directories before files' '
test "$dirline" -lt "$fileline"
'
+# --- Fork feature: built-in help page ----------------------------------------
+test_expect_success 'help tab appears on the index by default' '
+ cgit_query "" >tmp &&
+ grep "p=help" tmp
+'
+
+test_expect_success 'help page renders the workflow guide' '
+ cgit_query "p=help" >tmp &&
+ grep "Compare two points in history" tmp
+'
+
+test_expect_success 'enable-help=0 hides the tab and the page' '
+ {
+ echo "virtual-root=/" &&
+ echo "cache-size=0" &&
+ echo "enable-help=0" &&
+ echo "repo.url=sec" &&
+ echo "repo.path=$PWD/repos/sec/.git"
+ } >nohelprc &&
+ CGIT_CONFIG="$PWD/nohelprc" QUERY_STRING="" cgit >tmp &&
+ ! grep "p=help" tmp &&
+ CGIT_CONFIG="$PWD/nohelprc" QUERY_STRING="p=help" cgit >tmp &&
+ grep "Status: 404" tmp
+'
+
test_done