Sha256: 1d94ef7188ef14294eceda656bdcd1a13ba02b337fae424c0e78aa14122a4b30

Contents?: true

Size: 1.44 KB

Versions: 30

Compression:

Stored size: 1.44 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

describe "Coinbase" do

  def assert_valid_coinbase_attrs(account_or_details)
    [:user_id, :user_name, :user_email].each do |attr|
      [nil,""].should_not include(account_or_details.send(attr))
    end
  end

  it "is no longer supported with transaction#create" do
    result = Braintree::Transaction.sale(:payment_method_nonce => Braintree::Test::Nonce::Coinbase, :amount => "0.02")
    result.should_not be_success

    result.errors.for(:transaction).first.code.should == Braintree::ErrorCodes::PaymentMethod::PaymentMethodNoLongerSupported
  end

  it "is no longer supported for vaulting" do
    customer = Braintree::Customer.create!
    result = Braintree::PaymentMethod.create(:customer_id => customer.id, :payment_method_nonce => Braintree::Test::Nonce::Coinbase)
    result.should_not be_success

    result.errors.for(:coinbase_account).first.code.should == Braintree::ErrorCodes::PaymentMethod::PaymentMethodNoLongerSupported
  end

  it "is no longer supported when creating a Customer with a Coinbase payment method nonce" do
    expect do
      Braintree::Customer.create!(:payment_method_nonce => Braintree::Test::Nonce::Coinbase)
    end.to raise_error { |error|
      error.should be_a(Braintree::ValidationsFailed)
      error.error_result.errors.for(:coinbase_account).first.code.should == Braintree::ErrorCodes::PaymentMethod::PaymentMethodNoLongerSupported
    }
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
braintree-2.104.1 spec/integration/braintree/coinbase_spec.rb
braintree-2.104.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.103.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.102.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.101.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.100.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.99.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.98.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.97.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.96.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.95.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.94.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.93.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.92.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.91.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.90.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.89.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.88.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.87.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.86.0 spec/integration/braintree/coinbase_spec.rb