scinote-web/spec/factories/repository_stock_values.rb
artoscinote 229a27750f
Implement stock consumption via the API [SCI-6642] (#3964)
* Implement stock consumption via the API [SCI-6642]

* Remove unnecessary attribute from InventoryItemSerializer [SCI-6642]

* Amend permission check, add nested transaction support to consume_stock method [SCI-6642]
2022-03-30 14:33:26 +02:00

15 lines
521 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :repository_stock_value do
created_by { create :user }
last_modified_by { created_by }
repository_stock_unit_item
amount { 1000.0 }
after(:build) do |repository_stock_value|
repository_stock_value.repository_cell ||= build(:repository_cell,
:stock_value,
repository_stock_value: repository_stock_value)
end
end
end