test/support/restfully_accesible_stub.rb in yao-0.9.0 vs test/support/restfully_accesible_stub.rb in yao-0.9.1
- old
+ new
@@ -7,9 +7,20 @@
status: 200,
body: %Q[{#{resource_name}: "dummy"}]
)
end
+ def stub_get_request_with_json_response(url, body)
+ stub_request(:get, url)
+ .with(
+ headers: request_headers
+ ).to_return(
+ status: 200,
+ headers: {'Content-Type' => 'application/json'},
+ body: body.to_json
+ )
+ end
+
def stub_get_request_not_found(url)
stub_request(:get, url)
.with(
headers: request_headers
).to_return(