spec/spec_helper.rb in restful_resource-0.8.5 vs spec/spec_helper.rb in restful_resource-0.8.6
- old
+ new
@@ -13,5 +13,11 @@
end
def expect_put(url, response, data: {})
expect(@mock_http).to receive(:put).with(url, data).and_return(response)
end
+
+def expect_put_with_unprocessable_entity(url, response, data: {})
+ rest_client_response = OpenStruct.new({body: response.body, headers: response.headers, code: response.status})
+ exception = RestfulResource::HttpClient::UnprocessableEntity.new(rest_client_response)
+ expect(@mock_http).to receive(:put).with(url, data).and_raise(exception)
+end