Is there a way to make VCR active only when called via rspec in a Rails app? It works great for my tests, but I don't want it to intercept requests when outside of those tests.
I get Real HTTP connections are disabled if I use a client to connect to the my app and the app is calling an external web service.
Thanks, Marc
I finally got this work as desired with Rails. I was able to disable VCR (WebMock, actually, which is the backend I chose for VCR) except when I'm running rspec. For background, I initially followed the instructions here when setting up VCR.
First, I create
config/initializers/webmock.rb
:Then I added the following around
VCR.use_cassette()
(in my case this is inspec_helper.rb
:Hope that helps someone.