Sha256: b08587dcb3e3fdecee20ed0169cc38e1ecdc03fc440e5ce382f5c25ee031a31f

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

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

describe Braintree::PayPalAccount do
  describe "token" do
    it "has a token identifier" do
      params = {:unknown_payment_method => {:token => 1234, :default => true}}
      Braintree::UnknownPaymentMethod.new(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(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(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(params).should_not be_default
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
braintree-2.35.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.34.1 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.34.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.33.1 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.33.0 spec/unit/braintree/unknown_payment_method_spec.rb
braintree-2.32.1 spec/unit/braintree/unknown_payment_method_spec.rb