mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-20 19:56:48 +00:00
Ensure distributor is set on payment method factories
This commit is contained in:
@@ -158,6 +158,18 @@ FactoryGirl.modify do
|
||||
state { Spree::State.find_by_name 'Victoria' }
|
||||
country { Spree::Country.find_by_name 'Australia' || Spree::Country.first }
|
||||
end
|
||||
|
||||
factory :payment do
|
||||
ignore do
|
||||
distributor { order.distributor || Enterprise.is_distributor.first || FactoryGirl.create(:distributor_enterprise) }
|
||||
end
|
||||
payment_method { FactoryGirl.create(:payment_method, distributor: distributor) }
|
||||
end
|
||||
|
||||
factory :payment_method do
|
||||
distributor { Enterprise.is_distributor.first || FactoryGirl.create(:distributor_enterprise) } #Always need a distributor
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user