spec/stub_helper.rb in airborne-0.1.19 vs spec/stub_helper.rb in airborne-0.1.20
- old
+ new
@@ -22,11 +22,12 @@
def mock_patch(url, options = {}, status = 200)
stub_request(:patch, @base_url + url).with(body: options[:request_body] || {})
.to_return(headers: options[:response_headers] || {}, body: get_json_response_file(url), status: status)
end
- def mock_delete(url)
- stub_request(:delete, @base_url + url)
+ def mock_delete(url, options = {}, status = 200)
+ stub_request(:delete, @base_url + url).with(body: options[:request_body] || {})
+ .to_return(headers: options[:response_headers] || {}, body: get_json_response_file(url), status: status)
end
def mock_head(url, response_headers = {}, status = 200)
stub_request(:head, @base_url + url).to_return(headers: response_headers, body: nil, status: status)
end