From 0c687f4ad5193bbf5b8429a47140e45db408fc80 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 18 Sep 2013 12:13:48 +0200 Subject: refactor: stub_customer test helper --- billing/test/functional/payments_controller_test.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'billing/test/functional/payments_controller_test.rb') diff --git a/billing/test/functional/payments_controller_test.rb b/billing/test/functional/payments_controller_test.rb index 055a990..dd742ba 100644 --- a/billing/test/functional/payments_controller_test.rb +++ b/billing/test/functional/payments_controller_test.rb @@ -17,9 +17,7 @@ class PaymentsControllerTest < ActionController::TestCase end test "payment when authenticated as customer" 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 get :new assert_not_nil assigns(:tr_data) -- cgit v1.2.3 From 7398048b0fa261cd3178cb5309858eb845d01c77 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 18 Sep 2013 13:58:01 +0200 Subject: minor: include missing CustomerTestHelper --- billing/test/functional/payments_controller_test.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'billing/test/functional/payments_controller_test.rb') diff --git a/billing/test/functional/payments_controller_test.rb b/billing/test/functional/payments_controller_test.rb index dd742ba..655aa16 100644 --- a/billing/test/functional/payments_controller_test.rb +++ b/billing/test/functional/payments_controller_test.rb @@ -2,6 +2,7 @@ require 'test_helper' require 'fake_braintree' class PaymentsControllerTest < ActionController::TestCase + include CustomerTestHelper test "payment when unauthorized" do get :new -- cgit v1.2.3