mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-18 00:17:25 +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' }
|
state { Spree::State.find_by_name 'Victoria' }
|
||||||
country { Spree::Country.find_by_name 'Australia' || Spree::Country.first }
|
country { Spree::Country.find_by_name 'Australia' || Spree::Country.first }
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user