- Microservices Development Cookbook
- Paul Osman
- 65字
- 2021-07-16 17:48:28
Getting ready
We'll use the webmock gem for stubbing out external HTTP requests in our tests, so update your monolith gemfile to include the webmock gem in the test group:
group :test do
# ...
gem 'webmock'
end
You should also update spec/spec_helper.rb to disable external network requests. That will keep you honest when writing the rest of your test code:
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: false)