Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Move the root-readme test to the index tests
The test reads the index and the site about page, both drawn by
ui-repolist.c. Its site had no repositories, so the index it read was
the error page, and a readme printed below the list went unseen. The
shared repositories give it a real index.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0101-index.sh | 12 | |
| -rwxr-xr-x | tests/t0301-security.sh | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index e3d2148..d3d4469 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -44,6 +44,18 @@ test_expect_success 'each css and js entry gets a link of its own' ' grep "/b.js" scripts ' +# root-readme is the site's own file rather than repository content, so it +# goes out as written, on an about page of its own. +test_expect_success 'root-readme without a filter is its own page, as written' ' + echo "<b>site</b>" >root.html && + cgitrc_copy rootrc "root-readme=$PWD/root.html" && + cgit_ok rootrc "url=" >tmp && + test_grep "<li><a title=.About this site. href=./?p=about.>about</a>" tmp && + test_grep ! "<b>site</b>" tmp && + cgit_ok rootrc "p=about" >tmp && + test_grep "^<b>site</b>$" tmp +' + # The description limit counts bytes, so a cut has to land between # characters rather than leave half of one on the page. test_expect_success 'a cut description keeps whole characters' ' diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index 870d2c5..6ea8d45 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -104,18 +104,6 @@ test_expect_success 'non-markdown readme without a filter is escaped as plain te test_grep ! "<script>alert(2)</script>" tmp ' -# root-readme is the site's own file rather than repository content, so it -# goes out as written, on an about page of its own. -test_expect_success 'root-readme without a filter is its own page, as written' ' - echo "<b>site</b>" >root.html && - cgitrc_site secrootrc "root-readme=$PWD/root.html" && - cgit_rc secrootrc "url=" >tmp && - grep "<li><a title=.About this site. href=./?p=about.>about</a>" tmp && - ! grep "<b>site</b>" tmp && - cgit_rc secrootrc "p=about" >tmp && - grep "^<b>site</b>$" tmp -' - # A Content-Security-Policy without unsafe-inline stops an inline onchange # handler from ever running, so the option form submits through a plain # button and its selects carry no handlers at all, and nor does any other |
