Browse Source

remove imp details of wip

master
Jørgen Lien Sellæg 9 years ago
parent
commit
1065a5f88f
  1. 11
      toREST/include/torrents.hpp
  2. 11
      toREST/tests/torrents_test.cpp

11
toREST/include/torrents.hpp

@ -1,9 +1,9 @@
#ifndef _TR_TORRENTS_HPP_
#define _TR_TORRENTS_HPP_
#include <boost/filesystem.hpp>
#include <http.hpp>
#include <libtorrent/magnet_uri.hpp>
#include <util.hpp>
#include <boost/filesystem.hpp>
namespace tr {
namespace session {
@ -84,11 +84,6 @@ void post(settings opts, torrent_session &session, response resp, request req) {
} else
params.save_path = boost::filesystem::path(opts.root_dir / opts.default_download_dir).string();
// if (request_object.find("paused") != request_object.end()) {
// }
session.async_add_torrent(params);
std::stringstream ss;
@ -96,10 +91,6 @@ void post(settings opts, torrent_session &session, response resp, request req) {
http_response.add_header({"Location", "/session/torrents/" + ss.str()});
return respond(http::created);
// session.async_add_torrent(params);
// http_response.add_header({"Location",params.info_hash.to_string()});
}
}
}

11
toREST/tests/torrents_test.cpp

@ -95,17 +95,6 @@ SCENARIO("We are running a POST /session/torrents resource") {
REQUIRE((torrent_session.get_torrents()[0]).status().save_path == "/music");
}
}
// tr::session::torrents::get(torrent_session, response, request);
// CommonResponse::ok(response, {{"torrents", nlohmann::json::array()}});
// }
// }
// GIVEN("we have at least one torrent") {
// auto t_torrent = TestTorrent();
// torrent_session.get_torrents().emplace_back(t_torrent);
// THEN("the server should reply with an array of torrents") {
// tr::session::torrents::get(torrent_session, response, request);
// CommonResponse::ok(response, {{"torrents", {torrent}}});
// };
}
WHEN("we recive an invalid request") {
GIVEN("the request doesn't contain valid json") {

Loading…
Cancel
Save