From e1fb13b49133f38c84d93a2eda0a00fb37c47d9d Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sun, 23 Aug 2020 13:19:36 +0100 Subject: [PATCH] Bring payment method factory from spree_core and merge with modification --- spec/factories.rb | 4 ---- spec/factories/payment_method_factory.rb | 13 +++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 spec/factories/payment_method_factory.rb diff --git a/spec/factories.rb b/spec/factories.rb index f705ad1292..9accd0c00c 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -162,10 +162,6 @@ FactoryBot.define do end FactoryBot.modify do - factory :payment_method do - distributors { [Enterprise.is_distributor.first || FactoryBot.create(:distributor_enterprise)] } - end - factory :option_type do # Prevent inconsistent ordering in specs when all option types have the same (0) position sequence(:position) diff --git a/spec/factories/payment_method_factory.rb b/spec/factories/payment_method_factory.rb new file mode 100644 index 0000000000..b957f2a56e --- /dev/null +++ b/spec/factories/payment_method_factory.rb @@ -0,0 +1,13 @@ +FactoryGirl.define do + factory :payment_method, class: Spree::PaymentMethod::Check do + name 'Check' + environment 'test' + + distributors { [Enterprise.is_distributor.first || FactoryBot.create(:distributor_enterprise)] } + end + + factory :bogus_payment_method, class: Spree::Gateway::Bogus do + name 'Credit Card' + environment 'test' + end +end