Bring back our card factory modification

Merging Spree's an our factory didn't really work.
This commit is contained in:
Pau Perez
2020-07-10 11:40:04 +02:00
parent d8b748a851
commit 8fbbb0bb64

View File

@@ -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 {