How can I block external connections with RSpec & Capybara?
问题 With my Rails project, I would like to write tests non-ideal conditions such as lack of internet connection or timeouts. For example, I am using a gem to contact an API and would like to make sure that I handle the error correctly if there is a connection issue between my app and the external API. I can do this already by making a fixture with VCR and removing the response from the "cassette". However, this has drawbacks: It has to be done manually. The cassettes can not be gitignored if I am