test/integration_helper.rb in peddler-2.0.4 vs test/integration_helper.rb in peddler-2.1.0
- old
+ new
@@ -11,20 +11,21 @@
def use(endpoint)
@current_endpoint = endpoint
end
def clients
- @clients ||= build_clients
+ klass = MWS.const_get("#{current_endpoint}::Client")
+ ::Credentials.to_a.shuffle.each_with_object([]) do |credentials, memo|
+ client = klass.new(credentials)
+ country_code = client.marketplace.country_code
+ memo.define_singleton_method(country_code.downcase) { client }
+ memo << client
+ end
end
private
- def build_clients
- klass = MWS.const_get("#{current_endpoint}::Client")
- ::Credentials.map { |credentials| klass.new(credentials) }.shuffle
- end
-
def current_endpoint
@current_endpoint ||= name.sub('Test', '')
end
end
@@ -36,10 +37,11 @@
::Peddler::VCRMatcher.ignore_seller!
VCR.configure do |c|
c.before_record do |interaction|
%w[
- BuyerName BuyerEmail Name AddressLine1 PostalCode Phone Amount
+ BuyerName BuyerEmail Name AddressLine1 City StateOrProvinceCode PostalCode
+ Phone Amount AmazonOrderId SellerOrderId
].each do |key|
interaction.response.body.gsub!(/<#{key}>[^<]+</, "<#{key}>FILTERED<")
end
end