Sha256: 22c5d3a75722bece464881e38e32b60e62eeacd5f9d2473996afdac79fdc7206

Contents?: true

Size: 1.23 KB

Versions: 10

Compression:

Stored size: 1.23 KB

Contents

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

describe Braintree::EnrichedCustomerData do
  describe "self.new" do
    it "is protected" do
      expect do
        Braintree::EnrichedCustomerData.new
      end.to raise_error(NoMethodError, /protected method .new/)
    end
  end

  describe "self._new" do
    it "initializes the object with the appropriate attributes set" do

      address = {
        street_address: "a-street-address",
        extended_address: "an-extended-address",
        locality: "a-locality",
        region: "a-region",
        postal_code: "a-postal-code"
      }
      params = {
        fields_updated: ["username"],
        profile_data: {
          username: "a-username",
          first_name: "a-first-name",
          last_name: "a-last-name",
          phone_number: "a-phone-number",
          email: "a-email",
          billing_address: address,
          shipping_address: address,
        },
      }

      payment_method_customer_data_updated = Braintree::EnrichedCustomerData._new(params)

      expect(payment_method_customer_data_updated.profile_data).to be_a(Braintree::VenmoProfileData)
      expect(payment_method_customer_data_updated.fields_updated).to eq(["username"])
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
braintree-4.25.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.24.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.23.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.22.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.21.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.20.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.19.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.18.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.17.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.16.0 spec/unit/braintree/enriched_customer_data_spec.rb