Super Fast VCR Configuration for RSpec and MiniTest
You determined to use VCR by reading following from the README:
Record your test suite’s HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
But the README of VCR gem has a little clutter and the configuration mentioned there shows few deprecation warning when we run the spec.
Here is a configuration which will work best for most of the cases with RSpec (and also with minitest).
Configure following gems in Gemfile and bundle
Create following file as mentioned in the comment below
Modify rails_helper.rb/spec_helper.rb to add following line at the top
require 'support / vcr_setup'
You can now use it in your spec. I strongly recommend to Ryan Bates Video to get to know how VCR works.
At BoTree Technologies, we build enterprise applications with our RoR team of 25+ engineers.
Consulting is free – let us help you grow!
Choose Your Language
- Digital Marketing
- IT Consulting
- Project Management