From 2cbafc754d5e14811c808f65ce9e60b4d4bf7df5 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 15:54:22 -1000 Subject: Add a help page with common workflows --- tests/t0200-security.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests') 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 -- cgit v2.8.0