Sha256: a2b2188f596b08b5d208b76120f038b2c409d629d639fcb85655ae14e148a4bb

Contents?: true

Size: 608 Bytes

Versions: 32

Compression:

Stored size: 608 Bytes

Contents

require 'spree/testing_support/factories/shipment_factory'
require 'spree/testing_support/factories/inventory_unit_factory'

FactoryGirl.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: stock_location,
            shipping_method: shipping_method
          )
        )
      ]
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
solidus_core-2.3.1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.2.2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.1.1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.0.3 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-1.4.2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-1.3.2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.3.0 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.3.0.rc3 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.3.0.rc2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.3.0.rc1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.3.0.beta1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.0.2 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-1.4.1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.2.1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.2.0 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.2.0.rc1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.2.0.beta1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.1.0 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.1.0.rc1 lib/spree/testing_support/factories/carton_factory.rb
solidus_core-2.0.1 lib/spree/testing_support/factories/carton_factory.rb