Sha256: b35baa3f6172fdfc773100fcd2d5c46ffd3c0c694a07a48b83d4dd0f6bfa799d

Contents?: true

Size: 967 Bytes

Versions: 9

Compression:

Stored size: 967 Bytes

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

      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",
        },
      }

      payment_method_customer_data_updated = Braintree::EnrichedCustomerData._new(params)

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.13.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.12.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.11.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.10.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.9.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.8.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.7.0 spec/unit/braintree/enriched_customer_data_spec.rb
braintree-4.6.0 spec/unit/braintree/enriched_customer_data_spec.rb