summaryrefslogtreecommitdiff
path: root/billing/test/unit
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-08-31 15:15:53 +0200
committerAzul <azul@leap.se>2013-09-03 08:54:25 +0200
commit214ef762a970989e09be1960c5551c0a4d3f4421 (patch)
treeab3f296496071937d0bb51aa55eacbee989065fe /billing/test/unit
parent859b79d0dcd53c85bb57e3db888a1af702802987 (diff)
do not leave behind users in billing unit and functional tests
Diffstat (limited to 'billing/test/unit')
-rw-r--r--billing/test/unit/customer_test.rb4
-rw-r--r--billing/test/unit/customer_with_payment_info_test.rb5
2 files changed, 7 insertions, 2 deletions
diff --git a/billing/test/unit/customer_test.rb b/billing/test/unit/customer_test.rb
index 2ea0b5e..6156f87 100644
--- a/billing/test/unit/customer_test.rb
+++ b/billing/test/unit/customer_test.rb
@@ -1,9 +1,11 @@
require 'test_helper'
class CustomerTest < ActiveSupport::TestCase
+ include StubRecordHelper
setup do
- @customer = FactoryGirl.build(:customer)
+ @user = find_record :user
+ @customer = FactoryGirl.build(:customer, user: @user)
end
test "test set of attributes should be valid" do
diff --git a/billing/test/unit/customer_with_payment_info_test.rb b/billing/test/unit/customer_with_payment_info_test.rb
index ca89e65..0589a59 100644
--- a/billing/test/unit/customer_with_payment_info_test.rb
+++ b/billing/test/unit/customer_with_payment_info_test.rb
@@ -2,9 +2,11 @@ require 'test_helper'
require 'fake_braintree'
class CustomerWithPaymentInfoTest < ActiveSupport::TestCase
+ include StubRecordHelper
setup do
- @customer = FactoryGirl.build(:customer_with_payment_info)
+ @user = find_record :user
+ @customer = FactoryGirl.build(:customer_with_payment_info, user: @user)
end
test "has payment_info" do
@@ -28,6 +30,7 @@ class CustomerWithPaymentInfoTest < ActiveSupport::TestCase
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