Files
openfoodnetwork/spec/factories/payment_method_factory.rb
Luis Ramos 859d34c235 Remove nice trick to reuse traits by copy pasting the traits to each of
the 3 factories

I cannot figure out out to make this work again...
2020-08-23 14:35:58 +01:00

24 lines
630 B
Ruby

FactoryBot.define do
factory :payment_method, class: Spree::PaymentMethod::Check do
name 'Check'
environment 'test'
distributors { [Enterprise.is_distributor.first || FactoryBot.create(:distributor_enterprise)] }
trait :flat_rate do
transient { amount 1 }
calculator { build(:calculator_flat_rate, preferred_amount: amount) }
end
trait :per_item do
transient { amount 1 }
calculator { build(:calculator_per_item, preferred_amount: amount) }
end
end
factory :bogus_payment_method, class: Spree::Gateway::Bogus do
name 'Credit Card'
environment 'test'
end
end