spec/integration/spec_helper.rb in braintree-2.31.0 vs spec/integration/spec_helper.rb in braintree-2.32.1

- old
+ new

@@ -22,6 +22,28 @@ def create_modification_for_tests(attributes) config = Braintree::Configuration.gateway.config config.http.post "/modifications/create_modification_for_tests", :modification => attributes end + + def with_other_merchant(merchant_id, public_key, private_key, &block) + old_merchant_id = Braintree::Configuration.merchant_id + old_public_key = Braintree::Configuration.public_key + old_private_key = Braintree::Configuration.private_key + + Braintree::Configuration.merchant_id = merchant_id + Braintree::Configuration.public_key = public_key + Braintree::Configuration.private_key = private_key + + begin + yield + ensure + Braintree::Configuration.merchant_id = old_merchant_id + Braintree::Configuration.public_key = old_public_key + Braintree::Configuration.private_key = old_private_key + end + end + + def with_altpay_merchant(&block) + with_other_merchant("altpay_merchant", "altpay_merchant_public_key", "altpay_merchant_private_key", &block) + end end