diff options
author | claucece <soficeli0@gmail.com> | 2015-10-05 21:57:05 -0500 |
---|---|---|
committer | claucece <soficeli0@gmail.com> | 2015-10-05 23:05:48 -0500 |
commit | 775835dc1b9a8f79cdd53d450fd6cd35f131b4a6 (patch) | |
tree | 62956df18378b83ae7a59a4bf257340be7970a7e /engines/billing/test/unit/customer_with_payment_info_test.rb | |
parent | 2d4765030451934aaba643f7131eb6f8d6442b28 (diff) |
add test to payments and subscriptions
Diffstat (limited to 'engines/billing/test/unit/customer_with_payment_info_test.rb')
-rw-r--r-- | engines/billing/test/unit/customer_with_payment_info_test.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/engines/billing/test/unit/customer_with_payment_info_test.rb b/engines/billing/test/unit/customer_with_payment_info_test.rb deleted file mode 100644 index 0589a59..0000000 --- a/engines/billing/test/unit/customer_with_payment_info_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'test_helper' -require 'fake_braintree' - -class CustomerWithPaymentInfoTest < ActiveSupport::TestCase - include StubRecordHelper - - setup do - @user = find_record :user - @customer = FactoryGirl.build(:customer_with_payment_info, user: @user) - end - - test "has payment_info" do - assert @customer.braintree_customer_id - assert @customer.has_payment_info? - end - - test "constructs customer with braintree data" do - @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 "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 - @customer.destroy - end - - test "sets default_credit_card" do - @customer.with_braintree_data! - assert_equal @customer.credit_cards.first, @customer.default_credit_card - end -end |