Sha256: dfb7d3c3e85cb439e6df638112b6c17f716910cdd498582fbb80b1bf28b2febc
Contents?: true
Size: 815 Bytes
Versions: 17
Compression:
Stored size: 815 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) } order { create(:order_with_line_items, line_items_count: 2) } contents [] end initialize_with { new(stock_location, order, contents) } factory :stock_package_fulfilled do after(:build) do |package, evaluator| evaluator.order.line_items.reload evaluator.order.line_items.each do |line_item| package.add line_item, line_item.quantity, :on_hand end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems