#include #include #include #include SCENARIO("We are running a GET /session/torrents/id resource") { auto torrent_session = TestSession(); auto response = std::make_shared(); auto request = std::make_shared(); GIVEN("the server is not working properly and we recive a reqest") { THEN("the server should reply with service unavailable") { tr::session::torrents::id::get(torrent_session, response, request); CommonResponse::service_unavailable(response); } } auto torrent = TestTorrent(); torrent_session.valid = true; GIVEN("we have the server is working properly and we recive a request") { WHEN("the request path is a proper id") { request->path = "/session/torrents/" + torrent_id; GIVEN("we have the torrent") { torrent_session.theTorrentExists(); THEN("the response should be a json representation of the torrent") { tr::session::torrents::id::get(torrent_session, response, request); // CommonResponse::ok(response,{torrent_json}); } } } } }