Sha256: 8975e5fd0ac41c4ba48ad78b78f5dccdeb8bc64ab1441c4db116fd80d947b36e

Contents?: true

Size: 579 Bytes

Versions: 68

Compression:

Stored size: 579 Bytes

Contents

FactoryGirl.define do
  factory :shipment, class: Spree::Shipment do
    tracking 'U10000'
    cost 100.00
    state 'pending'
    order
    stock_location

    after(:create) do |shipment, evalulator|
      shipment.add_shipping_method(create(:shipping_method), true)

      shipment.order.line_items.each do |line_item|
        line_item.quantity.times do
          shipment.inventory_units.create(
            order_id: shipment.order_id,
            variant_id: line_item.variant_id,
            line_item_id: line_item.id
          )
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
spree_core-3.1.14 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.13 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.4 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.2.7 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.12 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.3 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.2.6 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.11 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.10 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.2 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.2.5 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.9 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.1 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.2.4 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.8 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.0 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.0.rc4 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.3.0.rc3 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.1.7 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-3.2.3 lib/spree/testing_support/factories/shipment_factory.rb