spec/cases/api_spec.rb in koala-1.4.0 vs spec/cases/api_spec.rb in koala-1.4.1
- old
+ new
@@ -57,11 +57,11 @@
it "returns the body of the request as JSON if no http_component is given" do
response = stub('response', :body => 'body', :status => 200)
Koala.stub(:make_request).and_return(response)
json_body = mock('JSON body')
- MultiJson.stub(:decode).and_return([json_body])
+ MultiJson.stub(:load).and_return([json_body])
@service.api('anything').should == json_body
end
it "executes an error checking block if provided" do
@@ -71,10 +71,10 @@
yield_test = mock('Yield Tester')
yield_test.should_receive(:pass)
@service.api('anything', {}, "get") do |arg|
yield_test.pass
- arg.should == MultiJson.decode(body)
+ arg.should == MultiJson.load(body)
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', {}))