#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) { return RequestContext(nullptr, "", url, "GET", "1.1"); } 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"(