diff options
author | Azul <azul@leap.se> | 2013-09-18 12:13:48 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-09-18 12:13:48 +0200 |
commit | 0c687f4ad5193bbf5b8429a47140e45db408fc80 (patch) | |
tree | 8fbbf9ddfebad6ed90fb075c986dbbb43129f712 /billing/test/functional/subsciptions_controller_test.rb | |
parent | 18a00ade1a88887b9a99c72ed2054fa2012ae2dc (diff) |
refactor: stub_customer test helper
Diffstat (limited to 'billing/test/functional/subsciptions_controller_test.rb')
-rw-r--r-- | billing/test/functional/subsciptions_controller_test.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/billing/test/functional/subsciptions_controller_test.rb b/billing/test/functional/subsciptions_controller_test.rb index bf8cf85..a6a1057 100644 --- a/billing/test/functional/subsciptions_controller_test.rb +++ b/billing/test/functional/subsciptions_controller_test.rb @@ -2,11 +2,10 @@ require 'test_helper' require 'fake_braintree' class SubscriptionsControllerTest < ActionController::TestCase + include CustomerTestHelper test "destroy cancels subscription" do - user = find_record :user - customer = stub_record :customer_with_payment_info, user: user - Customer.stubs(:find_by_user_id).with(user.id).returns(customer) + customer = stub_customer login customer.user result = Braintree::Subscription.create plan_id: 'my_plan', payment_method_token: customer.braintree_customer.credit_cards.first.token |