Sha256: 41656d4d74136f6fd048d14ecd4eff7fead241ce85f13c880ccc277bae0f8a98

Contents?: true

Size: 1.22 KB

Versions: 93

Compression:

Stored size: 1.22 KB

Contents

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

describe Braintree::PayPalAccount do
  before(:each) do
    @gateway = OpenStruct.new()
  end

  describe "token" do
    it "has a token identifier" do
      params = {:unknown_payment_method => {:token => 1234, :default => true}}
      Braintree::UnknownPaymentMethod.new(@gateway, params).token.should == 1234
    end
  end

  describe "image_url" do
    it "has a image_url" do
      params = {:unknown_payment_method => {:token => 1234, :default => true}}
      Braintree::UnknownPaymentMethod.new(@gateway, params).image_url.should == "https://assets.braintreegateway.com/payment_method_logo/unknown.png"
    end
  end

  describe "default?" do
    it "is true if the paypal account is the default payment method for the customer" do
      params = {:unknown_payment_method => {:token => 1234, :default => true}}
      Braintree::UnknownPaymentMethod.new(@gateway, params).should be_default
    end

    it "is false if the paypal account is not the default payment methodfor the customer" do
      params = {:unknown_payment_method => {:token => 1234, :default => false}}
      Braintree::UnknownPaymentMethod.new(@gateway, params).should_not be_default
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.13.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.12.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.11.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.10.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.9.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.8.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.7.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.6.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.5.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.4.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.3.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.2.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.1.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-4.0.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-3.4.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-3.3.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-3.2.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-3.1.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-3.0.1 spec/unit/braintree/unknown_payment_method_spec.rb