Sha256: d57ad7a68484229c183188fe9ba5d3421e109712ec25e327aa889075142ff01c

Contents?: true

Size: 441 Bytes

Versions: 8

Compression:

Stored size: 441 Bytes

Contents

FactoryBot.define do
  factory :product, class: "Comee::Core::Product" do
    transient do
      root { Comee::Core::Product.where(code: "ROOT", name: "Products", leaf: false).first_or_create }
    end
    sequence(:code) { |n| "#{Faker::Alphanumeric.unique.alpha(number: 6)}-#{n}" }
    name { Faker::Name.name }
    description { Faker::Lorem.sentence }
    leaf { true }
    ancestry { root.id.to_s }
    preferred_units { [] }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
comee_core-0.1.53 spec/factories/comee/core/products.rb
comee_core-0.1.52 spec/factories/comee/core/products.rb
comee_core-0.1.51 spec/factories/comee/core/products.rb
comee_core-0.1.50 spec/factories/comee/core/products.rb
comee_core-0.1.49 spec/factories/comee/core/products.rb
comee_core-0.1.48 spec/factories/comee/core/products.rb
comee_core-0.1.47 spec/factories/comee/core/products.rb
comee_core-0.1.46 spec/factories/comee/core/products.rb