summaryrefslogtreecommitdiff
path: root/billing/test
diff options
context:
space:
mode:
Diffstat (limited to 'billing/test')
-rw-r--r--billing/test/unit/customer_with_payment_info_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/billing/test/unit/customer_with_payment_info_test.rb b/billing/test/unit/customer_with_payment_info_test.rb
index f887674..ca89e65 100644
--- a/billing/test/unit/customer_with_payment_info_test.rb
+++ b/billing/test/unit/customer_with_payment_info_test.rb
@@ -20,6 +20,16 @@ class CustomerWithPaymentInfoTest < ActiveSupport::TestCase
assert_equal Hash.new, @customer.custom_fields
end
+ test "can access braintree_customer after reload" do
+ @customer.save
+ @customer = Customer.find_by_user_id(@customer.user_id)
+ @customer.with_braintree_data!
+ assert_equal 'Big', @customer.first_name
+ assert_equal 'Spender', @customer.last_name
+ assert_equal 1, @customer.credit_cards.size
+ assert_equal Hash.new, @customer.custom_fields
+ end
+
test "sets default_credit_card" do
@customer.with_braintree_data!
assert_equal @customer.credit_cards.first, @customer.default_credit_card