spec/integration/braintree/customer_spec.rb in braintree-2.44.0 vs spec/integration/braintree/customer_spec.rb in braintree-2.45.0
- old
+ new
@@ -757,9 +757,23 @@
apple_pay_card.token.should_not be_nil
apple_pay_card.expiration_year.should_not be_nil
apple_pay_card.payment_instrument_name.should == "AmEx 41002"
end
+ it "returns associated AndroidPayCards" do
+ result = Braintree::Customer.create(
+ :payment_method_nonce => Braintree::Test::Nonce::AndroidPay
+ )
+ result.success?.should == true
+
+ found_customer = Braintree::Customer.find(result.customer.id)
+ found_customer.android_pay_cards.should_not be_nil
+ android_pay_card = found_customer.android_pay_cards.first
+ android_pay_card.should be_a Braintree::AndroidPayCard
+ android_pay_card.token.should_not be_nil
+ android_pay_card.expiration_year.should_not be_nil
+ end
+
it "works for a blank customer" do
created_customer = Braintree::Customer.create!
found_customer = Braintree::Customer.find(created_customer.id)
found_customer.id.should == created_customer.id
end