2017-01-26 13:27:30 +01:00
|
|
|
require 'factory_bot'
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :invoice do
|
|
|
|
supplier
|
2023-05-12 13:01:12 +02:00
|
|
|
number { rand(1..99_999) }
|
2017-01-26 13:27:30 +01:00
|
|
|
amount { rand(0.1..26.0).round(2) }
|
2023-05-12 13:01:12 +02:00
|
|
|
created_by { create(:user) }
|
2017-01-26 13:27:30 +01:00
|
|
|
|
|
|
|
after :create do |invoice|
|
|
|
|
invoice.supplier.reload
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|