summaryrefslogtreecommitdiff
path: root/spec/factories/product.rb
blob: ab65cd0f41a98ad4a4c4c121c89eb4b448d87338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

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