#include "../src/server/response.h" #include "gtest/gtest.h" #include "../src/server/request_context.h" namespace { using namespace kiwix; RequestContext makeHttpGetRequest(const std::string& url, const RequestContext::NameValuePairs& headers, const RequestContext::NameValuePairs& queryArgs) { return RequestContext("", url, "GET", "1.1", headers, queryArgs); } std::string getResponseContent(const ContentResponseBlueprint& crb) { return crb.generateResponseObject()->getContent(); } } // unnamed namespace TEST(HTTPErrorResponse, shouldBeInEnglishByDefault) { const RequestContext req = makeHttpGetRequest("/asdf", {}, {}); HTTPErrorResponse errResp(req, MHD_HTTP_NOT_FOUND, "404-page-title", "404-page-heading", "/css/error.css"); EXPECT_EQ(getResponseContent(errResp), R"(