Sha256: 382e7da7e5d1595e70e072e4b9ba8b02dc6c1f9ab6cccbbb3bcd08e4734b8789

Contents?: true

Size: 1.07 KB

Versions: 36

Compression:

Stored size: 1.07 KB

Contents

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

describe Braintree::PayPalAccount do
  describe "self.update" do
    it "raises an exception if attributes contain an invalid key" do
      expect do
        Braintree::PayPalAccount.update("some_token", :invalid_key => 'val')
      end.to raise_error(ArgumentError, "invalid keys: invalid_key")
    end
  end

  describe "default?" do
    it "is true if the paypal account is the default payment method for the customer" do
      Braintree::PayPalAccount._new(:gateway, :default => true).default?.should == true
    end

    it "is false if the paypal account is not the default payment methodfor the customer" do
      Braintree::PayPalAccount._new(:gateway, :default => false).default?.should == false
    end
  end

  describe "timestamps" do
    it "exposes created_at and updated_at" do
      now = Time.now
      paypal_account = Braintree::PayPalAccount._new(:gateway, :updated_at => now, :created_at => now)

      paypal_account.created_at.should == now
      paypal_account.updated_at.should == now
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
braintree-2.66.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.65.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.64.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.63.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.62.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.61.1 spec/unit/braintree/paypal_account_spec.rb
braintree-2.61.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.60.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.59.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.58.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.57.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.56.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.55.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.54.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.50.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.49.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.48.1 spec/unit/braintree/paypal_account_spec.rb
braintree-2.48.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.47.0 spec/unit/braintree/paypal_account_spec.rb
braintree-2.46.0 spec/unit/braintree/paypal_account_spec.rb