spec/spec_helper.rb in braintree-2.69.1 vs spec/spec_helper.rb in braintree-2.70.0

- old
+ new

@@ -38,10 +38,11 @@ NonDefaultSubMerchantAccountId = "sandbox_sub_merchant_account" ThreeDSecureMerchantAccountId = "three_d_secure_merchant_account" FakeAmexDirectMerchantAccountId = "fake_amex_direct_usd" FakeVenmoAccountMerchantAccountId = "fake_first_data_venmo_account" UsBankMerhantAccountId = "us_bank_merchant_account" + IdealMerchantAccountId = "ideal_merchant_account" TrialPlan = { :description => "Plan for integration tests -- with trial", :id => "integration_trial_plan", :price => BigDecimal.new("43.21"), @@ -79,10 +80,12 @@ Discount7 = "discount_7" Discount11 = "discount_11" Discount15 = "discount_15" + DefaultOrderId = "ABC123" + TestMerchantConfig = Braintree::Configuration.new( :logger => Logger.new("/dev/null"), :environment => Braintree::Configuration.environment, :merchant_id => "test_merchant_id", :public_key => "test_public_key", @@ -105,10 +108,24 @@ config = Braintree::Configuration.instantiate response = config.http.post("#{config.base_merchant_path}/three_d_secure/create_verification/#{merchant_account_id}", :three_d_secure_verification => params) response[:three_d_secure_verification][:three_d_secure_token] end + def self.create_merchant(params={}) + gateway = Braintree::Gateway.new( + :client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id", + :client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret", + :logger => Logger.new("/dev/null") + ) + + gateway.merchant.create({ + :email => "name@email.com", + :country_code_alpha3 => "GBR", + :payment_methods => ["credit_card", "paypal"], + }.merge!(params)) + end + def self.stub_time_dot_now(desired_time) Time.class_eval do class << self alias original_now now end @@ -203,8 +220,8 @@ config.expect_with :rspec do |expect| expect.syntax = [:should, :expect] end config.mock_with :rspec do |mock| - mock.syntax = :should + mock.syntax = [:should, :expect] end end