I'm currently trying to get VCR to run correctly for my app. Right now everything seems to be configured right but I must be missing something because when the test that uses the VCR.use_cassette
is not render the response in the yml file I have set up. I'll post all of my code that is pertaining the issue and let me know if I'm doing something wrong.
/support/vcr.rb:
VCR.configure do |c|
c.configure_rspec_metadata!
c.cassette_library_dir = Rails.root.join("spec", "vcr")
c.hook_into :webmock
c.after_http_request do |request, _response|
VCR.http_requests_made << request
end
end
Request spec:
require "rails_helper"
describe "Mailchimp" do
describe "Manage list" do
let!(:subscriber) { FactoryGirl.create(:subscriber) }
it "adds new subscriber to list" do
expect do
VCR.use_cassettes("mailchimp/list") do
post new_subscriber_path
end.to change(:subscriber, :count).by(1)
end
end
end
end
YML file: /vcr/mailchimp/list.yml
NOTHING RENDERS. THIS IS WHERE I EXPECT THE RESPONSE FOR VCR BUT I"M GETTING NOTHING.
Hopefully this is enough info. let me know if you need more?
Try adding
VCR.configure do |config|
config.allow_http_connections_when_no_cassette = true
end