Installazione VCR
Crea il file spec/plugins/vcr_config.rb e aggiungilo al file rails_helper.rb
require 'plugins/vcr-config'Aggiungere al file spec_helper.rb
require 'webmock/rspec'Nello stesso file aggiungere il codice sottostante
# frozen_string_literal: true
require 'vcr'
# rubocop:disable Layout/SpaceAroundOperators
VCR.configure do |config|
config.cassette_library_dir = 'spec/vcr/cassettes'
config.hook_into :webmock
config.configure_rspec_metadata!
config.ignore_localhost = true
config.allow_http_connections_when_no_cassette = true
end
# rubocop:enable Layout/SpaceAroundOperatorsLast updated
Was this helpful?