# frozen_string_literal: true FactoryBot.define do factory :product, class: 'Product' do name { Faker::Commerce.product_name } unitary_price { rand(1.0..1000.0) } bulk_price { rand(1.0..1000.0) } available_quantity { rand(1..1000) } company { create(:company) } categories do c = [] (1..rand(5)).each do c.push(Faker::Commerce.department(max: 1)) end c end end end