spec/cases/api_spec.rb in koala-1.5.0 vs spec/cases/api_spec.rb in koala-1.6.0.rc1
- old
+ new
@@ -63,18 +63,18 @@
@service.api('anything').should == json_body
end
it "executes an error checking block if provided" do
- body = '{}'
- Koala.stub(:make_request).and_return(Koala::HTTPService::Response.new(200, body, {}))
+ response = Koala::HTTPService::Response.new(200, '{}', {})
+ Koala.stub(:make_request).and_return(response)
yield_test = mock('Yield Tester')
yield_test.should_receive(:pass)
@service.api('anything', {}, "get") do |arg|
yield_test.pass
- arg.should == MultiJson.load(body)
+ arg.should == response
end
end
it "raises an API error if the HTTP response code is greater than or equal to 500" do
Koala.stub(:make_request).and_return(Koala::HTTPService::Response.new(500, 'response body', {}))