spec/resources/statement_spec.rb in thebigdb-1.2.1 vs spec/resources/statement_spec.rb in thebigdb-1.2.2
- old
+ new
@@ -3,21 +3,21 @@
describe "Statement" do
context "basic request executing" do
before do
stub_request(:get, @request_path.call("search")).to_return(:body => '{"server_says": "hello world"}')
- @request = TheBigDB::Statement(:search, nodes: ["a", "b"])
+ @request = TheBigDB::Statement(:search, nodes: ["a a", "b"])
end
it "sets the correct data_sent instance variable" do
@request.data_sent.should == {
"headers" => Hash[@request.http_request.to_hash.map{|k,v| [k, v.join] }],
"host" => TheBigDB.api_host,
"port" => TheBigDB.api_port,
"path" => "/v#{TheBigDB.api_version}/statements/search",
"method" => "GET",
- "params" => {"nodes" => {"0" => "a", "1" => "b"}}
+ "params" => {"nodes" => {"0" => "a a", "1" => "b"}}
}
end
it "sets the correct data_received instance variable" do
@request.data_received.should include({
@@ -31,12 +31,12 @@
describe "StatementRequest" do
before do
end
it "makes normal requests" do
- @search = TheBigDB.search("a", "b", {match: "blue"})
+ @search = TheBigDB.search("a a", "b", {match: "blue"})
@search.with(page: 2)
- @search.params.should == {"nodes" => ["a", "b", {match: "blue"}], "page" => 2}
+ @search.params.should == {"nodes" => ["a a", "b", {match: "blue"}], "page" => 2}
end
it "cache the response unless the params are modified, or asked to" do
stub_request(:get, @request_path.call("search")).to_return(:body => '{status: "success", statements: []}')
\ No newline at end of file