You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
880 B
25 lines
880 B
|
9 years ago
|
#include <ServerContext.hpp>
|
||
|
|
#include <SessionContext.hpp>
|
||
|
|
#include <TorrentContext.hpp>
|
||
|
|
#include <torrent.hpp>
|
||
|
|
|
||
|
|
SCENARIO("We are running a GET /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") {
|
||
|
|
WHEN("we recive a request") {
|
||
|
|
tr::session::torrents::id::get(torrent_session, response, request);
|
||
|
|
THEN("the server should reply with service unavailable") {
|
||
|
|
CommonResponse::service_unavailable(response);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
GIVEN("the server is working properly") {
|
||
|
|
torrent_session.valid = true;
|
||
|
|
THEN("the server should reply with service unavailable") {
|
||
|
|
tr::session::torrents::id::get(torrent_session, response, request);
|
||
|
|
CommonResponse::ok(response, {});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|