mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Bring options factories from spree_core and merge with modification
This commit is contained in:
@@ -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 }
|
||||
|
||||
15
spec/factories/options_factory.rb
Normal file
15
spec/factories/options_factory.rb
Normal 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
|
||||
Reference in New Issue
Block a user