spec/integration/braintree/address_spec.rb in braintree-4.20.0 vs spec/integration/braintree/address_spec.rb in braintree-4.21.0
- old
+ new
@@ -13,10 +13,11 @@
:street_address => "1811 E Main St",
:extended_address => "Suite 200",
:locality => "Chicago",
:region => "Illinois",
:phone_number => "5551231234",
+ :international_phone => {:country_code => "1", :national_number => "3121234567"},
:postal_code => "60622",
:country_name => "United States of America",
)
expect(result.success?).to eq(true)
expect(result.address.customer_id).to eq(customer.id)
@@ -26,10 +27,12 @@
expect(result.address.street_address).to eq("1811 E Main St")
expect(result.address.extended_address).to eq("Suite 200")
expect(result.address.locality).to eq("Chicago")
expect(result.address.region).to eq("Illinois")
expect(result.address.phone_number).to eq("5551231234")
+ expect(result.address.international_phone[:country_code]).to eq("1")
+ expect(result.address.international_phone[:national_number]).to eq("3121234567")
expect(result.address.postal_code).to eq("60622")
expect(result.address.country_name).to eq("United States of America")
expect(result.address.country_code_alpha2).to eq("US")
expect(result.address.country_code_alpha3).to eq("USA")
expect(result.address.country_code_numeric).to eq("840")
@@ -239,10 +242,11 @@
:extended_address => "New Suite 3",
:locality => "Chicago",
:region => "Illinois",
:postal_code => "60621",
:country_name => "United States of America",
+ :international_phone => {:country_code => "1", :national_number => "3121234567"},
)
expect(result.success?).to eq(true)
expect(result.address.street_address).to eq("123 E New St")
expect(result.address.extended_address).to eq("New Suite 3")
expect(result.address.locality).to eq("Chicago")
@@ -250,9 +254,11 @@
expect(result.address.postal_code).to eq("60621")
expect(result.address.country_name).to eq("United States of America")
expect(result.address.country_code_alpha2).to eq("US")
expect(result.address.country_code_alpha3).to eq("USA")
expect(result.address.country_code_numeric).to eq("840")
+ expect(result.address.international_phone[:country_code]).to eq("1")
+ expect(result.address.international_phone[:national_number]).to eq("3121234567")
end
it "accepts country_codes" do
customer = Braintree::Customer.create!(:last_name => "Miller")
address = Braintree::Address.create!(