debian-mirror-gitlab/spec/models/work_items/hierarchy_restriction_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
534 B
Ruby
Raw Permalink Normal View History

2023-03-04 22:38:38 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe WorkItems::HierarchyRestriction do
describe 'associations' do
it { is_expected.to belong_to(:parent_type) }
it { is_expected.to belong_to(:child_type) }
end
describe 'validations' do
subject { build(:hierarchy_restriction) }
it { is_expected.to validate_presence_of(:parent_type) }
it { is_expected.to validate_presence_of(:child_type) }
it { is_expected.to validate_uniqueness_of(:child_type).scoped_to(:parent_type_id) }
end
end