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