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
|
|
|
|
|
2019-11-21 23:22:15 +08:00
|
|
|
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
|