mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
29 lines
795 B
Ruby
29 lines
795 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe RepositoryStatusItem do
|
|
let(:repository_status_item) { build :repository_status_item }
|
|
|
|
it 'is valid' do
|
|
expect(repository_status_item).to be_valid
|
|
end
|
|
|
|
describe 'Validations' do
|
|
describe '#icon' do
|
|
it { is_expected.to validate_presence_of(:icon) }
|
|
end
|
|
|
|
describe '#status' do
|
|
it { is_expected.to validate_presence_of(:status) }
|
|
it { is_expected.to validate_length_of(:status).is_at_most(255) }
|
|
end
|
|
end
|
|
|
|
describe 'Associations' do
|
|
it { is_expected.to belong_to(:repository_column) }
|
|
it { is_expected.to belong_to(:created_by).optional }
|
|
it { is_expected.to belong_to(:last_modified_by).optional }
|
|
it { is_expected.to have_many(:repository_status_values) }
|
|
end
|
|
end
|