Sha256: ce1c231a13d4e1f0649ccf561de12e5ed42f0ddfa0581ff5e46467da0540ca12

Contents?: true

Size: 367 Bytes

Versions: 15

Compression:

Stored size: 367 Bytes

Contents

require 'spree/testing_support/factories/order_factory'
require 'spree/testing_support/factories/product_factory'

FactoryGirl.define do
  factory :line_item, class: Spree::LineItem do
    quantity 1
    price { BigDecimal.new('10.00') }
    order
    transient do
      product nil
    end
    variant do
      (product || create(:product)).master
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solidus_core-2.3.1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.2.2 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.1.1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.3.0 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.3.0.rc3 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.3.0.rc2 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.3.0.rc1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.3.0.beta1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.2.1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.2.0 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.2.0.rc1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.2.0.beta1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.1.0 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.1.0.rc1 lib/spree/testing_support/factories/line_item_factory.rb
solidus_core-2.1.0.beta1 lib/spree/testing_support/factories/line_item_factory.rb