Sometimes when working with VCR you still want to use webmock. Since VCR hooks into webmock and fails when an unknown request is happening, you have to turn it off in order to use webmock like you are used to. Here is how to do this in rspec.
RSpec.configure do |config|
config.around do | example |
if example.metadata[:turn_off_vcr]
VCR.turn_off!
example.run
VCR.turn_on!
else
example.run
end
end
end
Posted to makandra dev (2017-10-11 12:51)