diff options
author | John Hawthorn <john@stembolt.com> | 2017-04-18 14:08:32 -0700 |
---|---|---|
committer | Brendan Deere <brendan.g.deere@gmail.com> | 2017-05-23 03:43:05 -0700 |
commit | 47735dc25a80b2b95432814341c32c31205a0852 (patch) | |
tree | f2c26646e45bd060b0448e3ae056d32b6dfb40af /lib/solidus_subscriptions/testing_support | |
parent | 2deac6d200887f8e3e83bf492110d79879793c32 (diff) |
Ensure user exists when setting CC#default=true
This is necessary to support the new wallet schema in Solidus 2.2
Diffstat (limited to 'lib/solidus_subscriptions/testing_support')
-rw-r--r-- | lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb index 222f9ef..036b4c2 100644 --- a/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb +++ b/lib/solidus_subscriptions/testing_support/factories/subscription_factory.rb @@ -5,8 +5,9 @@ FactoryGirl.define do interval_units :month user do - ccs = build_list(:credit_card, 1, gateway_customer_profile_id: 'BGS-123', default: true) - build :user, :subscription_user, credit_cards: ccs + create(:user, :subscription_user).tap do |user| + create(:credit_card, gateway_customer_profile_id: 'BGS-123', user: user, default: true) + end end trait :with_line_item do |