August 2018
Intermediate to advanced
260 pages
5h 48m
English
Now that you have webmock included in your project, you can start stubbing HTTP requests in your specs. Once again, open specs/spec_helper.rb and add the following content:
stub_request(:post, "attachment-service.yourorg.example.com"). with(body: {media_type: 1}, headers: {"Content-Type" => /image\/.+/}). to_return(body: { foo: bar })
Read now
Unlock full access