Bring options factories from spree_core and merge with modification

This commit is contained in:
Luis Ramos
2020-08-23 13:21:49 +01:00
parent e1fb13b491
commit 6819042489
2 changed files with 15 additions and 5 deletions

View File

@@ -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 }

View File

@@ -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