Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Set the site title once in the markup tests
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0005-markup.sh | 14 |
1 file changed, 8 insertions, 6 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 8251393..c05f404 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -8,6 +8,10 @@ test_description='Check the markup hooks a theme relies on' CGIT_TEST_NO_CREATE_REPOS=YesPlease . ./setup.sh +# The site gets a title of its own, as a page that wrote the default out as +# a fixed string would otherwise pass for one that read root-title. +site=Example + test_expect_success 'set up a repository with a file that has an extension' ' mkrepo repos/hooks 2 && ( @@ -17,7 +21,8 @@ test_expect_success 'set up a repository with a file that has an extension' ' git add dir && git commit -m sources ) && - cgitrc_repo hooksrc hooks enable-blame=1 max-stats=year readme=:file-1 + cgitrc_repo hooksrc hooks enable-blame=1 max-stats=year readme=:file-1 \ + "root-title=$site" ' test_expect_success 'the root names the page and the repository' ' @@ -106,7 +111,6 @@ test_expect_success 'the blob, blame and about pages open with their own contain ' test_expect_success 'each page names itself, then the repository and the site' ' - site="Git repository browser" && cgit_rc hooksrc "url=hooks/" >tmp && grep "<title>hooks - $site</title>" tmp && for page in about log refs tree stats @@ -123,7 +127,6 @@ test_expect_success 'each page names itself, then the repository and the site' ' # A commit the page is pinned to belongs with the page's own name, or with the # repository's on the summary, which has no name of its own. test_expect_success 'a pinned page names its commit before the repository' ' - site="Git repository browser" && old=$(git -C repos/hooks rev-parse HEAD~1 | cut -c1-10) && cgit_rc hooksrc "url=hooks/tree/&id=$old" >tmp && grep "<title>tree @ $old - hooks - $site</title>" tmp && @@ -137,17 +140,16 @@ test_expect_success 'a pinned page names its commit before the repository' ' # which by default is the site's index. test_expect_success 'the logo is named after the site' ' cgit_rc hooksrc "url=hooks/" >tmp && - grep "<a class=.logo. href=./.><img src=./cgit.png. alt=.Git repository browser.></a>" tmp + grep "<a class=.logo. href=./.><img src=./cgit.png. alt=.$site.></a>" tmp ' test_expect_success 'an error page names the error where a page names itself' ' - site="Git repository browser" && cgit_rc hooksrc "url=hooks/tree/missing" >tmp && grep "^Status: 404" tmp && grep "<title>Not Found - hooks - $site</title>" tmp && cgit_rc hooksrc "url=hooks/nonsense/" >tmp && grep "<title>Not Found - hooks - $site</title>" tmp && - cgitrc_repo brokenrc broken "repo.path=$PWD/nowhere" && + cgitrc_repo brokenrc broken "root-title=$site" "repo.path=$PWD/nowhere" && cgit_rc brokenrc "url=broken/" >tmp && grep "Failed to open broken" tmp && grep "<title>Not Found - $site</title>" tmp |
