mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Add enterprise fee factory trait for per item rate
We should not presume what is not default for an enterprise fee object.
This commit is contained in:
@@ -270,6 +270,12 @@ FactoryBot.define do
|
||||
calculator { build(:calculator_per_item, preferred_amount: amount) }
|
||||
|
||||
after(:create) { |ef| ef.calculator.save! }
|
||||
|
||||
trait :per_item do
|
||||
transient { amount 1 }
|
||||
|
||||
calculator { build(:calculator_per_item, preferred_amount: amount) }
|
||||
end
|
||||
end
|
||||
|
||||
factory :product_distribution, :class => ProductDistribution do
|
||||
|
||||
Reference in New Issue
Block a user