Files
openfoodnetwork/spec/factories/voucher_factory.rb
Gaetan Craig-Riou 9c9a6234e1 Per review, clean up voucher specs
Add explicit 'order.item_total' to make specs more readable
2023-08-11 15:41:45 +10:00

18 lines
418 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :voucher, class: Voucher do
code { "new_code" }
enterprise { build(:distributor_enterprise) }
amount { 10 }
end
factory :voucher_flat_rate, parent: :voucher, class: Vouchers::FlatRate do
amount { 15 }
end
factory :voucher_percentage_rate, parent: :voucher, class: Vouchers::PercentageRate do
amount { rand(1..100) }
end
end