scinote-web/spec/models/repository_stock_unit_item_spec.rb
ajugo 1c21e11510
Stock management test [SCI-6420] (#3946)
* Initial test for stock management

* Repository stock values adding [does not work] SCI-6420

* Fix typos SCI-6420

* Fix test [SCI-6420]

* Test changes [SCI-6402]

* Remove locking test [SCI-6420]

* Remove lock [SCI-6420]

* Remove serializer [SCI-6420]

* Fix stock test and add ledger creation on consume [SCI-6420]
2022-04-15 12:23:47 +02:00

33 lines
909 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe RepositoryStockUnitItem, type: :model do
let(:repository_stock_unit_item) { build :repository_stock_unit_item }
it 'is valid' do
expect(repository_stock_unit_item).to be_valid
end
it 'should be of class RepositoryStockUnitItem' do
expect(subject.class).to eq RepositoryStockUnitItem
end
describe 'Database table' do
it { should have_db_column :id }
it { should have_db_column :data }
it { should have_db_column :repository_column_id }
it { should have_db_column :created_by_id }
it { should have_db_column :last_modified_by_id }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
end
describe 'Associations' do
it { should belong_to(:repository_column) }
it { should belong_to(:created_by) }
it { should belong_to(:last_modified_by) }
end
end