Sha256: 6d1b1767b676ce6661d2a13f8919190a320d8a95e9087531cc4fba2d3dd61645

Contents?: true

Size: 457 Bytes

Versions: 9

Compression:

Stored size: 457 Bytes

Contents

Factory.define(:variant) do |f|
  f.price 19.99
  f.cost_price 17.00
  f.sku    { Faker::Lorem.sentence }
  f.weight { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.height { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.width  { BigDecimal.new("#{rand(200)}.#{rand(99)}") }
  f.depth  { BigDecimal.new("#{rand(200)}.#{rand(99)}") }

  # associations:
  f.association(:product, :factory => :product)
  f.option_values { [Factory(:option_value)] }
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 test/factories/variant_factory.rb
spree-0.11.3 test/factories/variant_factory.rb
spree-0.11.2 test/factories/variant_factory.rb
spree-0.11.1 test/factories/variant_factory.rb
spree-0.11.0 test/factories/variant_factory.rb
spree-0.10.2 test/factories/variant_factory.rb
spree-0.10.1 test/factories/variant_factory.rb
spree-0.10.0 test/factories/variant_factory.rb
spree-0.10.0.beta test/factories/variant_factory.rb