test/support/restfully_accesible_stub.rb in yao-0.18.0 vs test/support/restfully_accesible_stub.rb in yao-0.19.0
- old
+ new
@@ -38,9 +38,20 @@
status: 401,
body: "unauthorized"
)
end
+ def stub_post_request(url, body, response = {})
+ stub_request(:post,url)
+ .with(
+ headers: request_headers
+ ).to_return(
+ status: 202,
+ headers: {'Content-Type' => 'application/json'},
+ body: response.to_json
+ )
+ end
+
def request_headers
{'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>"Yao/#{Yao::VERSION} Faraday/#{Faraday::VERSION}"}
end
end