From ad35ea1102ffa613e9adb2c820324e4d5910e685 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Sun, 9 Dec 2018 21:46:31 +0800 Subject: [PATCH] Add factory stock traits for variant overrides --- spec/factories.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/factories.rb b/spec/factories.rb index 8751094d45..eee3cb553f 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -189,9 +189,20 @@ FactoryBot.define do factory :variant_override, :class => VariantOverride do price 77.77 + on_demand false count_on_hand 11111 default_stock 2000 resettable false + + trait :on_demand do + on_demand true + count_on_hand nil + end + + trait :use_producer_stock_settings do + on_demand nil + count_on_hand nil + end end factory :inventory_item, :class => InventoryItem do