Add automatic generation of financial transactions and links
This commit is contained in:
parent
91eeac6c40
commit
8e2ca5e7d7
11 changed files with 284 additions and 0 deletions
15
spec/factories/invoice.rb
Normal file
15
spec/factories/invoice.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
require 'factory_bot'
|
||||
|
||||
FactoryBot.define do
|
||||
|
||||
factory :invoice do
|
||||
supplier
|
||||
number { rand(1..99999) }
|
||||
amount { rand(0.1..26.0).round(2) }
|
||||
|
||||
after :create do |invoice|
|
||||
invoice.supplier.reload
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue