|
|
|
|
@ -25,7 +25,27 @@ SCENARIO("We are running a GET /session/torrents/id resource") {
|
|
|
|
|
tr::session::torrents::id::get(torrent_session, response, request); |
|
|
|
|
CommonResponse::ok(response,{torrent_json}); |
|
|
|
|
} |
|
|
|
|
WHEN("The torrent isn't valid"){ |
|
|
|
|
torrent_session.torrents_.back().valid = false; |
|
|
|
|
THEN("the server should reply with bad request"){ |
|
|
|
|
tr::session::torrents::id::get(torrent_session, response, request); |
|
|
|
|
CommonResponse::bad_request(response); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCENARIO("We are running a PATCH /session/torrents/id resource") { |
|
|
|
|
auto torrent_session = TestSession(); |
|
|
|
|
auto response = std::make_shared<TestResponse>(); |
|
|
|
|
auto request = std::make_shared<TestRequest>(); |
|
|
|
|
GIVEN("the server is not working properly and we recive a reqest") { |
|
|
|
|
THEN("the server should reply with service unavailable") { |
|
|
|
|
tr::session::torrents::id::patch(torrent_session, response, request); |
|
|
|
|
CommonResponse::service_unavailable(response); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |