Sha256: a9120a4f565740eb4c22d8438a1d880b66afafca7e253b4f5b09f04feb92dc11

Contents?: true

Size: 1.17 KB

Versions: 40

Compression:

Stored size: 1.17 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 "works for transaction#create" do
    result = Braintree::Transaction.sale(:payment_method_nonce => Braintree::Test::Nonce::Coinbase, :amount => "0.02")
    result.should be_success
    assert_valid_coinbase_attrs(result.transaction.coinbase_details)
  end

  it "works for vaulting" do
    customer = Braintree::Customer.create!
    vaulted = Braintree::PaymentMethod.create(:customer_id => customer.id, :payment_method_nonce => Braintree::Test::Nonce::Coinbase).payment_method
    assert_valid_coinbase_attrs(vaulted)

    found = Braintree::PaymentMethod.find(vaulted.token).payment_method
    assert_valid_coinbase_attrs(found)
  end

  it "is returned on Customers" do
    customer = Braintree::Customer.create!(:payment_method_nonce => Braintree::Test::Nonce::Coinbase)
    customer.payment_methods.should == customer.coinbase_accounts
    assert_valid_coinbase_attrs(customer.coinbase_accounts[0])
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
braintree-2.60.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.59.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.58.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.57.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.56.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.55.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.54.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.50.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.49.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.48.1 spec/integration/braintree/coinbase_spec.rb
braintree-2.48.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.47.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.46.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.45.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.44.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.43.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.42.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.41.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.40.0 spec/integration/braintree/coinbase_spec.rb
braintree-2.39.0 spec/integration/braintree/coinbase_spec.rb