Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test the robots tag on ordinary pages
Only the login page's tag was checked, so printing noindex everywhere
would have taken every site out of the search engines and passed.
| -rwxr-xr-x | tests/t0005-markup.sh | 20 |
1 file changed, 20 insertions, 0 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 3f6b8e7..8251393 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -153,6 +153,26 @@ test_expect_success 'an error page names the error where a page names itself' ' grep "<title>Not Found - $site</title>" tmp ' +# A site is indexed but its links not followed unless robots says otherwise, +# and an empty value leaves the choice to the crawler. +test_expect_success 'the pages ask robots what the robots setting says' ' + cgit_ok hooksrc "url=hooks/" >tmp && + test_grep "<meta name=.robots. content=.index, nofollow.>" tmp && + { + echo "robots=noindex, noarchive" && + cat hooksrc + } >robotsrc && + cgit_ok robotsrc "url=hooks/" >tmp && + test_grep "<meta name=.robots. content=.noindex, noarchive.>" tmp && + { + echo "robots=" && + cat hooksrc + } >robotsrc && + cgit_ok robotsrc "url=hooks/" >tmp && + test_grep "<meta name=.generator." tmp && + test_grep ! "<meta name=.robots." tmp +' + # A browser gives these elements a monospace font of its own, which would # otherwise win over the one a theme sets through --font-mono. test_expect_success 'every monospace element takes the theme font' ' |
