Closed jdbann closed 1 month ago
Still, it can be easily fixed by something like that:
# spec/support/fake_stripe.rb
require 'webmock/rspec'
require 'fake_stripe'
RSpec.configure do |config|
config.before(:each) do
FakeStripe.stub_stripe
WebMock.disable!
WebMock.enable!
WebMock.disable_net_connect!(allow_localhost: true, allow: ['cloud.typography.com', 'cloud.typenetwork.com'])
end
end
Closing this because fake_stripe has been deprecated: https://github.com/thoughtbot/fake_stripe/pull/154
Added FakeStripe to a test suite not currently using WebMock and it blocked a number of calls to third-party services. Whilst I eventually want to mock all those calls, I didn't expect this gem to block anything beyond Stripe. Looks like the problem line is this in the WebMock initialiser.
WebMock.disable_net_connect!(allow_localhost: true)
I can put in a PR to remove that line but wanted to check if there was a reason it was in there? My assumption is that so the gem would catch any requests to Stripe that didn't match the two stubbed requests: