diff options
-rw-r--r-- | gentoobrowse/src/test.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/gentoobrowse/src/test.cpp b/gentoobrowse/src/test.cpp index 44fa32e..1841721 100644 --- a/gentoobrowse/src/test.cpp +++ b/gentoobrowse/src/test.cpp @@ -56,10 +56,29 @@ class ChromiumRequestXml : public ChromiumRequest { hdr["Accept"] = "application/xml"; } - virtual void standardAssertions(const char *) + virtual void standardAssertions(const char *) override { auto h = getResponseHeaders(); BOOST_REQUIRE_EQUAL(h["Status"], "200 OK"); + BOOST_REQUIRE_EQUAL(h["Content-Type"], "application/xml"); + xmlpp::DomParser p; + p.parse_stream(this->output); + } +}; + +class ChromiumRequestAtom : public ChromiumRequest { + public: + ChromiumRequestAtom(const Core * c, HttpMethod m, const std::string & p) : + ChromiumRequest(c, m, p) + { + hdr["Accept"] = "application/atom+xml"; + } + + virtual void standardAssertions(const char *) override + { + auto h = getResponseHeaders(); + BOOST_REQUIRE_EQUAL(h["Status"], "200 OK"); + BOOST_REQUIRE_EQUAL(h["Content-Type"], "application/atom+xml"); xmlpp::DomParser p; p.parse_stream(this->output); } @@ -156,5 +175,26 @@ BOOST_AUTO_TEST_CASE( search_sitemap ) request.standardAssertions(typeid(this).name()); } +BOOST_AUTO_TEST_CASE( home_atom ) +{ + ChromiumRequestAtom request(this, HttpMethod::GET, "/"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + +BOOST_AUTO_TEST_CASE( news_atom ) +{ + ChromiumRequestAtom request(this, HttpMethod::GET, "/news"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + +BOOST_AUTO_TEST_CASE( user_atom ) +{ + ChromiumRequestAtom request(this, HttpMethod::GET, "/atom/randomdan"); + process(&request); + request.standardAssertions(typeid(this).name()); +} + BOOST_AUTO_TEST_SUITE_END(); |