lib/parliament/utils/test_helpers/vcr_helper.rb in parliament-utils-0.8.4 vs lib/parliament/utils/test_helpers/vcr_helper.rb in parliament-utils-0.8.5

- old
+ new

@@ -39,11 +39,11 @@ hybrid_bills_match = request_1.uri.sub(ENV['HYBRID_BILL_API_BASE_URL'], hybrid_bills_uri) == request_2.uri.sub(ENV['HYBRID_BILL_API_BASE_URL'], hybrid_bills_uri) if ENV['HYBRID_BILL_API_BASE_URL'] parliament_match || bandiera_match || opensearch_match || hybrid_bills_match end - config.default_cassette_options = { match_requests_on: [:method, :filtered_uri] } + config.default_cassette_options = { match_requests_on: %i[method filtered_uri] } # Dynamically filter our sensitive information config.filter_sensitive_data('<AUTH_TOKEN>') { ENV['PARLIAMENT_AUTH_TOKEN'] } if ENV['PARLIAMENT_AUTH_TOKEN'] config.filter_sensitive_data(parliament_uri) { ENV['PARLIAMENT_BASE_URL'] } if ENV['PARLIAMENT_BASE_URL'] config.filter_sensitive_data(bandiera_uri) { ENV['BANDIERA_URL'] } if ENV['BANDIERA_URL'] @@ -53,10 +53,10 @@ # Dynamically filter n-triple data config.before_record do |interaction| should_ignore = ['_:node', '^^<http://www.w3.org/2001/XMLSchema#date>', '^^<http://www.w3.org/2001/XMLSchema#dateTime>', '^^<http://www.w3.org/2001/XMLSchema#integer>'] # Check if content type header exists and if it includes application/n-triples - if interaction.response.headers['Content-Type'] && interaction.response.headers['Content-Type'].include?('application/n-triples') + if interaction.response.headers['Content-Type']&.include?('application/n-triples') # Split our data by line lines = interaction.response.body.split("\n") # How many times have we seen a predicate? predicate_occurrances = Hash.new(1)