I often use VCR gem.
And I always configure it to use rspec metadata to turn it on with just :vcr
symbol.
When I know that some module will always hit the external service,
I turn VCR on at the very top describe
.
describe "Something", :vcr do
it "should make coffee" do
end
end
And when I add a new example, I want all requests to be live, until I get my test pass.
I can run any code without VCR in VCR.turned_off do ... end
block. I must eject the loaded cassette before with VCR.eject_cassette
(there must be a reason why it can't be done automatically).
And finally since I'm using webmock (by default), I have to ask it to let me do real requests with WebMock.allow_net_connect!
I think it's not fair when turning something on is easy, but turning it off isn't.
I would write
describe "Something", :vcr do
it "should make coffee" do
end
it "should be easy", :vcr_off do
end
end