blob: 4dfd19756cb72b068bad6bcb3a785a61eeabae25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe IssuableSeverity, type: :model do
let_it_be(:issuable_severity) { create(:issuable_severity) }
describe 'associations' do
it { is_expected.to belong_to(:issue) }
end
describe 'validations' do
it { is_expected.to validate_presence_of(:severity) }
it { is_expected.to validate_presence_of(:issue) }
it { is_expected.to validate_uniqueness_of(:issue) }
end
describe 'enums' do
let(:severity_values) do
{ unknown: 0, low: 1, medium: 2, high: 3, critical: 4 }
end
it { is_expected.to define_enum_for(:severity).with_values(severity_values) }
end
end
|