From 8fbbb0bb6496c04aafb0268725775714730ed5bc Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Fri, 10 Jul 2020 11:40:04 +0200 Subject: [PATCH] Bring back our card factory modification Merging Spree's an our factory didn't really work. --- spec/factories.rb | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/spec/factories.rb b/spec/factories.rb index edfe1d257b..455fc9b9a4 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -16,21 +16,6 @@ require 'spree/testing_support/factories' # * completed_order_with_totals # -# allows credit card info to be saved to the database which is needed for factories to work properly -class TestCard < Spree::CreditCard - def remove_readonly_attributes(attributes) attributes; end -end - -FactoryBot.define do - factory :credit_card, class: TestCard do - verification_value 123 - month 12 - year { Time.now.year + 1 } - number '4111111111111111' - cc_type 'visa' - end -end - FactoryBot.define do factory :classification, class: Spree::Classification do end @@ -198,6 +183,10 @@ FactoryBot.modify do country { Spree::Country.find_by name: 'Australia' || Spree::Country.first } end + factory :credit_card do + cc_type 'visa' + end + factory :payment do transient do distributor {