spec/api-client/dispatcher_spec.rb in api-client-1.1.1 vs spec/api-client/dispatcher_spec.rb in api-client-1.2.0
- old
+ new
@@ -5,19 +5,49 @@
before :each do
FakeWeb.register_uri(:get, "http://api.example.com/user/5", :status => "200")
end
it "should return the response code and body" do
- ApiClient::Base._get("http://api.example.com/user/5").should be_a(Net::HTTPOK)
+ ApiClient::Base._get("http://api.example.com/user/5", {}).should be_a(Net::HTTPOK)
end
end
describe "#_post" do
before :each do
FakeWeb.register_uri(:post, "http://api.example.com/user/5", :status => "201")
end
it "should return the response code and body" do
- ApiClient::Base._post("http://api.example.com/user/5", {}).should be_a(Net::HTTPCreated)
+ ApiClient::Base._post("http://api.example.com/user/5", {}, {}).should be_a(Net::HTTPCreated)
+ end
+ end
+
+ describe "#_put" do
+ before :each do
+ FakeWeb.register_uri(:put, "http://api.example.com/user/5", :status => "200")
+ end
+
+ it "should return the response code and body" do
+ ApiClient::Base._put("http://api.example.com/user/5", {}, {}).should be_a(Net::HTTPOK)
+ end
+ end
+
+ describe "#_patch" do
+ before :each do
+ FakeWeb.register_uri(:patch, "http://api.example.com/user/5", :status => "200")
+ end
+
+ it "should return the response code and body" do
+ ApiClient::Base._patch("http://api.example.com/user/5", {}, {}).should be_a(Net::HTTPOK)
+ end
+ end
+
+ describe "#_delete" do
+ before :each do
+ FakeWeb.register_uri(:delete, "http://api.example.com/user/5", :status => "200")
+ end
+
+ it "should return the response code and body" do
+ ApiClient::Base._delete("http://api.example.com/user/5", {}).should be_a(Net::HTTPOK)
end
end
end
\ No newline at end of file