scinote-web/spec/models/repository_checklist_value_spec.rb

29 lines
906 B
Ruby
Raw Normal View History

2019-12-06 21:16:20 +08:00
# frozen_string_literal: true
require 'rails_helper'
2019-12-09 20:38:40 +08:00
RSpec.describe RepositoryChecklistValue, type: :model do
let(:repository_checklist_item) { build :repository_checklist_item }
2019-12-09 20:38:40 +08:00
let(:repository_checklist_value) { build :repository_checklist_value }
2019-12-06 21:16:20 +08:00
it 'is valid' do
repository_checklist_value.repository_checklist_items << repository_checklist_item
2019-12-09 20:38:40 +08:00
expect(repository_checklist_value).to be_valid
2019-12-06 21:16:20 +08:00
end
2019-12-09 20:38:40 +08:00
it 'should be of class RepositoryChecklistValue' do
expect(subject.class).to eq RepositoryChecklistValue
2019-12-06 21:16:20 +08:00
end
describe 'Database table' do
it { should have_db_column :created_by_id }
it { should have_db_column :last_modified_by_id }
end
describe 'Relations' do
it { should belong_to(:created_by).class_name('User') }
it { should belong_to(:last_modified_by).class_name('User') }
it { should accept_nested_attributes_for(:repository_cell) }
end
end