Sha256: 7c696a3db2b73acb7e46871885289a5ffe74371652a628a3521d0509b23b27f8
Contents?: true
Size: 816 Bytes
Versions: 2
Compression:
Stored size: 816 Bytes
Contents
FactoryGirl.define do # must use build() factory :stock_packer, class: Spree::Stock::Packer do ignore do stock_location { build(:stock_location) } contents [] end initialize_with { new(stock_location, contents) } end factory :stock_package, class: Spree::Stock::Package do ignore 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 ignore { variants_contents { { build(:variant) => 2 } } } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
spree_core-2.4.0.rc2 | lib/spree/testing_support/factories/stock_factory.rb |
spree_core-2.4.0.rc1 | lib/spree/testing_support/factories/stock_factory.rb |