Sha256: f7674d729f63fbc1fe0d9d844728af827539b53438bec30125f6d9e8bd2465d9
Contents?: true
Size: 825 Bytes
Versions: 91
Compression:
Stored size: 825 Bytes
Contents
FactoryGirl.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
91 entries across 91 versions & 2 rubygems