diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a04e27d..226a5e1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,7 @@ Dir[Rails.root.join("spec/shared/**/*.rb")].each { |f| require f } Dir[File.join(__dir__, "support/**/*.rb")].each { |f| require f } +Dir[ManageIQ::Providers::Openstack::Engine.root.join("spec/support/**/*.rb")].sort.each { |f| require f } require "manageiq/providers/ibm_power_vc" @@ -13,19 +14,13 @@ def sanitizer(interaction) interaction.response.body.gsub!(/"host": "[^"]*?"/, '"host": "powervc.local"') end -def fix_token_expires_at(interaction) - data = JSON.parse(interaction.response.body) - data["token"]["expires_at"] = "9999-12-31T23:59:59.999999Z" - interaction.response.body = data.to_json.force_encoding('ASCII-8BIT') -end - VCR.configure do |config| config.ignore_hosts 'codeclimate.com' if ENV['CI'] config.cassette_library_dir = File.join(ManageIQ::Providers::IbmPowerVc::Engine.root, 'spec/vcr_cassettes') config.before_record do |i| sanitizer(i) - fix_token_expires_at(i) if i.request.uri.end_with?("v3/auth/tokens") + fix_token_expires_at_interaction(i) end config.define_cassette_placeholder(Rails.application.secrets.ibm_power_vc_defaults[:hostname]) do