Testing of "Fulltext search unavailable" page

This commit is contained in:
Veloman Yunkan 2022-01-30 15:59:17 +04:00
parent aaf232bee4
commit 511261cc81
3 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,5 @@
body{
background-color: white;
color: #000000;
font: small/normal Arial,Helvetica,Sans-Serif;
margin-top: 0.5em;

View File

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<meta content="text/html;charset=UTF-8" http-equiv="content-type" />
<title>Fulltext search unavailable</title>
<link type="text/css" href="{{root}}/skin/search_results.css" rel="Stylesheet" />
</head>
<body bgcolor="white">
<body>
<div class="header">Not found</div>
<p>
There is no article with the title <b> "{{pattern}}"</b>

View File

@ -662,6 +662,30 @@ TEST_F(ServerTest, 404WithBodyTesting)
Cannot find content entry invalid-article
</p>
)" },
{ /* url */ "/ROOT/search?content=zimfile",
expected_page_title=="Fulltext search unavailable" &&
expected_css_url=="/ROOT/skin/search_results.css" &&
book_name=="zimfile" &&
book_title=="Ray Charles" &&
expected_body==R"(
<div class="header">Not found</div>
<p>
There is no article with the title <b> ""</b>
and the fulltext search engine is not available for this content.
</p>
)" },
{ /* url */ "/ROOT/search?content=non-existent-book&pattern=asdfqwerty",
expected_page_title=="Fulltext search unavailable" &&
expected_css_url=="/ROOT/skin/search_results.css" &&
expected_body==R"(
<div class="header">Not found</div>
<p>
There is no article with the title <b> "asdfqwerty"</b>
and the fulltext search engine is not available for this content.
</p>
)" },
};
for ( const auto& t : testData ) {