mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Bring back our card factory modification
Merging Spree's an our factory didn't really work.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user