scinote-web/spec/models/repository_date_time_value_spec.rb

28 lines
704 B
Ruby
Raw Normal View History

2019-11-18 22:21:57 +08:00
# frozen_string_literal: true
require 'rails_helper'
describe RepositoryDateTimeValue, type: :model do
2019-12-06 21:20:37 +08:00
let(:repository_date_time_value) { build :repository_date_time_value }
2019-11-18 22:21:57 +08:00
it 'is valid' do
expect(repository_date_time_value).to be_valid
end
describe 'Validations' do
describe '#repository_cell' do
it { is_expected.to validate_presence_of(:repository_cell) }
end
describe '#data' do
it { is_expected.to validate_presence_of(:data) }
2019-11-18 22:21:57 +08:00
end
end
describe 'Associations' do
it { is_expected.to belong_to(:created_by).optional }
it { is_expected.to belong_to(:last_modified_by).optional }
it { is_expected.to have_one(:repository_cell) }
end
end