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-2.68.1 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.68.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.67.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.66.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.65.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.64.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.63.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.62.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.61.1 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.61.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.60.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.59.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.58.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.57.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.56.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.55.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.54.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.50.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.49.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.48.1 spec/unit/braintree/unknown_payment_method_spec.rb