Sha256: 8cd01451d1d009f38d4ef0b667f2af79995d720d70c6dd9284016d590e5e5dad
Contents?: true
Size: 690 Bytes
Versions: 22
Compression:
Stored size: 690 Bytes
Contents
# frozen_string_literal: true FactoryBot.define do factory :inventory_unit, class: 'Spree::InventoryUnit' do transient do order { nil } stock_location { nil } end association :variant, strategy: :create line_item do if order build(:line_item, variant: variant, order: order) else build(:line_item, variant: variant) end end state { 'on_hand' } shipment do if stock_location build(:shipment, state: 'pending', order: line_item.order, stock_location: stock_location) else build(:shipment, state: 'pending', order: line_item.order) end end # return_authorization end end
Version data entries
22 entries across 22 versions & 1 rubygems