Sha256: 688248adcf4f843b75224a76b7e23a766001234b85816f079667765717ca415b

Contents?: true

Size: 357 Bytes

Versions: 33

Compression:

Stored size: 357 Bytes

Contents

FactoryBot.define do
  factory :line_item, class: Spree::LineItem do
    order
    quantity { 1 }
    price    { BigDecimal('10.00') }
    currency { order.currency }
    product do
      if order&.store&.present?
        create(:product, stores: [order.store])
      else
        create(:product)
      end
    end
    variant { product.master }
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
spree_core-4.10.1 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.10.0 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.9.0 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.8.3 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.8.2 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.7.3 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.6 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.5.5 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.3.3 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.4.1 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.5.4 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.5 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.7.2 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.7.1 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.4 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.7.0 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.3 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.2 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.1 lib/spree/testing_support/factories/line_item_factory.rb
spree_core-4.6.0 lib/spree/testing_support/factories/line_item_factory.rb