Sha256: 9682ada567bcaa13a53ccee34e6e5cdd35dbd92ba6cf803490802409828e987f

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

require 'helper'
require 'recorder'
require 'dig_rb'

%w(mws.yml mws.yml.example).each do |path|
  file = File.expand_path("../#{path}", __FILE__)
  if File.exist?(file)
    $mws = YAML.load_file(file)
    break
  end
end

class IntegrationTest < MiniTest::Test
  include Recorder

  private

  def clients
    api = @api || test_name
    $mws.map do |record|
      MWS.const_get("#{api}::Client").new(record)
    end
  end
end

::Peddler::VCRMatcher.ignore_seller!

VCR.configure do |c|
  c.before_record do |interaction|
    %w(
      BuyerName BuyerEmail Name AddressLine1 PostalCode Phone Amount
    ).each do |key|
      interaction.response.body.gsub!(/<#{key}>[^<]+</, "<#{key}>FILTERED<")
    end
  end

  $mws.each do |record|
    c.filter_sensitive_data('FILTERED') { record['merchant_id'] }
    c.filter_sensitive_data('FILTERED') { record['aws_access_key_id'] }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
peddler-1.5.0 test/integration_helper.rb
peddler-1.4.1 test/integration_helper.rb
peddler-1.4.0 test/integration_helper.rb