Sha256: 0995da5f0edcf6872a79b8ca6d871b68f94bb4498e40997f65a3438334f31733

Contents?: true

Size: 484 Bytes

Versions: 3

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :carton, class: 'Spree::Carton' do
    address
    stock_location
    shipping_method
    shipped_at { Time.current }
    inventory_units do
      [
        build(
          :inventory_unit,
          # ensure the shipment uses the same stock location as the carton
          shipment: build(
            :shipment,
            stock_location:,
            shipping_method:
          )
        )
      ]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_core-4.4.2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-4.4.1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-4.4.0 lib/spree/testing_support/factories/carton_factory.rb