From 68190424898a92b5154d1cb0696dc48cd99cb68b Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sun, 23 Aug 2020 13:21:49 +0100 Subject: [PATCH] Bring options factories from spree_core and merge with modification --- spec/factories.rb | 5 ----- spec/factories/options_factory.rb | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 spec/factories/options_factory.rb diff --git a/spec/factories.rb b/spec/factories.rb index 9accd0c00c..8337e48a0c 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -162,11 +162,6 @@ FactoryBot.define do end FactoryBot.modify do - factory :option_type do - # Prevent inconsistent ordering in specs when all option types have the same (0) position - sequence(:position) - end - factory :stock_location, class: Spree::StockLocation do # keeps the test stock_location unique initialize_with { DefaultStockLocation.find_or_create } diff --git a/spec/factories/options_factory.rb b/spec/factories/options_factory.rb new file mode 100644 index 0000000000..5e5464090c --- /dev/null +++ b/spec/factories/options_factory.rb @@ -0,0 +1,15 @@ +FactoryGirl.define do + factory :option_value, class: Spree::OptionValue do + name 'Size' + presentation 'S' + option_type + end + + factory :option_type, class: Spree::OptionType do + name 'foo-size' + presentation 'Size' + + # Prevent inconsistent ordering in specs when all option types have the same (0) position + sequence(:position) + end +end