Sets flag to create folder with Stripe version

This commit is contained in:
filipefurtad0
2023-11-06 13:48:12 +00:00
committed by Maikel Linke
parent cbc2ef54c8
commit 7dac08a0be

View File

@@ -131,6 +131,21 @@ RSpec.configure do |config|
end
end
# Appends Stripe gem version to VCR cassette directory with ':stripe_version' flag
#
# When the Stripe gem is updated, we should re-record these cassettes:
#
# rm spec/fixtures/vcr_cassettes/Stripe-v* -r
# ./bin/rspec --tag stripe_version
config.around(:each, :stripe_version) do |example|
stripe_version = "Stripe-v#{Stripe::VERSION}"
VCR.configure do |vcr_config|
vcr_config.cassette_library_dir = "spec/fixtures/vcr_cassettes/#{stripe_version}"
vcr_config.default_cassette_options = { record: :none } if ENV["CI"]
end
example.run
end
# Geocoding
config.before(:each) {
allow_any_instance_of(Spree::Address).to receive(:geocode).and_return([1, 1])