From c29f16e0058c22a2e242ff4707aa207d206e9a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Sun, 14 May 2017 21:44:05 +0200 Subject: [PATCH] Missleading naming of method --- toREST/tests/stubs/ServerContext.cpp | 12 ++++++------ toREST/tests/torrents_test.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/toREST/tests/stubs/ServerContext.cpp b/toREST/tests/stubs/ServerContext.cpp index 948beba..26b2d9a 100644 --- a/toREST/tests/stubs/ServerContext.cpp +++ b/toREST/tests/stubs/ServerContext.cpp @@ -62,7 +62,7 @@ void header_present(std::shared_ptr response, const std::string &h REQUIRE(loc_itr->first == header); } -void is_json_request(std::shared_ptr response) { +void is_json_response(std::shared_ptr response) { const auto content = response->content(); auto obj = nlohmann::json::parse(content); REQUIRE(obj.is_object()); @@ -73,7 +73,7 @@ void is_json_request(std::shared_ptr response) { void CommonResponse::service_unavailable(std::shared_ptr response) { REQUIRE(response->code() == "503"); REQUIRE(response->message() == "Service Unavailable"); - is_json_request(response); + is_json_response(response); }; void CommonResponse::ok(std::shared_ptr response, const nlohmann::json &data) { @@ -81,7 +81,7 @@ void CommonResponse::ok(std::shared_ptr response, const nlohmann:: REQUIRE(response->code() == "200"); REQUIRE(response->message() == "OK"); REQUIRE(response->content() == data_dump); - is_json_request(response); + is_json_response(response); }; void CommonResponse::no_content(std::shared_ptr response) { @@ -93,17 +93,17 @@ void CommonResponse::no_content(std::shared_ptr response) { void CommonResponse::bad_request(std::shared_ptr response) { REQUIRE(response->code() == "400"); REQUIRE(response->message() == "Bad Request"); - is_json_request(response); + is_json_response(response); }; void CommonResponse::accepted(std::shared_ptr response) { REQUIRE(response->code() == "202"); REQUIRE(response->message() == "Accepted"); - is_json_request(response); + is_json_response(response); }; void CommonResponse::created(std::shared_ptr response, std::shared_ptr request, const std::string &location) { REQUIRE(response->code() == "201"); REQUIRE(response->message() == "Created"); - is_json_request(response); + is_json_response(response); header_present(response, "Location", location); }; \ No newline at end of file diff --git a/toREST/tests/torrents_test.cpp b/toREST/tests/torrents_test.cpp index eceb1a4..91931f4 100644 --- a/toREST/tests/torrents_test.cpp +++ b/toREST/tests/torrents_test.cpp @@ -71,7 +71,7 @@ SCENARIO("We are running a POST /session/torrents resource") { torrent_session.valid = true; WHEN("we recive a valid request") { GIVEN("we use the default download directory") { - AND_WHEN("we fill the magnet uri field"){ + AND_WHEN("we fill the magnet uri field") { THEN("the server should reply with created") { request->content << nlohmann::json::object({{"magnet_uri", magnet_uri}}); tr::session::torrents::post(settings, torrent_session, response, request);