From 47735dc25a80b2b95432814341c32c31205a0852 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 18 Apr 2017 14:08:32 -0700 Subject: Ensure user exists when setting CC#default=true This is necessary to support the new wallet schema in Solidus 2.2 --- .../testing_support/factories/subscription_factory.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3