Sha256: c1300d93c57dca067b6c6df8ed543c13da1ce60372eaf8acede0d074774a82bf
Contents?: true
Size: 824 Bytes
Versions: 24
Compression:
Stored size: 824 Bytes
Contents
FactoryBot.define do # must use build() factory :stock_packer, class: Spree::Stock::Packer do transient do stock_location { build(:stock_location) } contents [] end initialize_with { new(stock_location, contents) } end factory :stock_package, class: Spree::Stock::Package do transient do stock_location { build(:stock_location) } contents { [] } variants_contents { {} } end initialize_with { new(stock_location, contents) } after(:build) do |package, evaluator| evaluator.variants_contents.each do |variant, count| package.add_multiple build_list(:inventory_unit, count, variant: variant) end end factory :stock_package_fulfilled do transient { variants_contents { { build(:variant) => 2 } } } end end end
Version data entries
24 entries across 24 versions & 2 rubygems