Sha256: 19777ba1e55b6342b0ba027272483a09b28e9b8ae60c7f82a053f894a1e4942b

Contents?: true

Size: 482 Bytes

Versions: 17

Compression:

Stored size: 482 Bytes

Contents

FactoryGirl.define do
  factory :shipment, class: Spree::Shipment do
    tracking 'U10000'
    number '100'
    cost 100.00
    state 'pending'
    order
    address
    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 { shipment.inventory_units.create(variant_id: line_item.variant_id) }
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spree_core-2.0.13 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.12 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.11 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.10 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.6 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.5 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.9 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.4 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.8 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.3 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.7 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.2 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.6 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.1 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.5 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.1.0 lib/spree/testing_support/factories/shipment_factory.rb
spree_core-2.0.4 lib/spree/testing_support/factories/shipment_factory.rb