I want to record the API response once and use is forever but it seems like VCR wants to re-record after sometime is elapsed.
I tried to google how to disable it. Found re_record_interval
but it seems like not working.
My current VCS setup is
spec/support/vcr_setup.rb
# frozen_string_literal: true
VCR.configure do |c|
c.cassette_library_dir = 'spec/vcr'
c.hook_into :webmock
c.configure_rspec_metadata!
c.allow_http_connections_when_no_cassette = false
c.default_cassette_options = {
record: :none,
re_record_interval: nil,
match_requests_on: %i[method uri],
allow_playback_repeats: true
}
c.debug_logger = $stdout
end
This is the debug log from VCR
[Cassette: 'some-name./1:1:6:2:1:1'] Initialized with options: {:record=>:none, :record_on_error=>true, :match_requests_on=>[:method, :uri], :allow_unused_http_interactions=>true, :serialize_with=>:yaml, :persist_with=>:file_system, :re_record_interval=>nil, :allow_playback_repeats=>true}
Scraping url: some-url
[webmock] Handling request: [get some-url] (disabled: false)
[Cassette: 'some-name/1:1:6:2:1:1'] Initialized HTTPInteractionList with request matchers [:method, :uri] and 0 interaction(s): { }
[webmock] Identified request type (unhandled) for [get some-url]
Note: There's a recorded file for which was getting an hour before but now VCR is trying to a new HTTP request and create a new record file.