spec/spec_helper.rb in restful_resource-0.10.2 vs spec/spec_helper.rb in restful_resource-1.0.0
- old
+ new
@@ -23,15 +23,17 @@
def expect_post(url, response, data: {})
expect(@mock_http).to receive(:post).with(url, data: data).and_return(response)
end
def expect_put_with_unprocessable_entity(url, response, data: {})
+ request = RestfulResource::Request.new(:put, url, body: data)
rest_client_response = OpenStruct.new({body: response.body, headers: response.headers, code: response.status})
- exception = RestfulResource::HttpClient::UnprocessableEntity.new(rest_client_response)
+ exception = RestfulResource::HttpClient::UnprocessableEntity.new(request, rest_client_response)
expect(@mock_http).to receive(:put).with(url, data: data).and_raise(exception)
end
def expect_post_with_unprocessable_entity(url, response, data: {})
+ request = RestfulResource::Request.new(:put, url, body: data)
rest_client_response = OpenStruct.new({body: response.body, headers: response.headers, code: response.status})
- exception = RestfulResource::HttpClient::UnprocessableEntity.new(rest_client_response)
+ exception = RestfulResource::HttpClient::UnprocessableEntity.new(request, rest_client_response)
expect(@mock_http).to receive(:post).with(url, data: data).and_raise(exception)
end