gitlab-org--gitlab-foss/spec/models/group_custom_attribute_spec.rb

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

19 lines
496 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-09-18 11:07:38 -04:00
require 'spec_helper'
RSpec.describe GroupCustomAttribute do
2017-09-18 11:07:38 -04:00
describe 'assocations' do
it { is_expected.to belong_to(:group) }
end
describe 'validations' do
subject { build :group_custom_attribute }
it { is_expected.to validate_presence_of(:group) }
it { is_expected.to validate_presence_of(:key) }
it { is_expected.to validate_presence_of(:value) }
it { is_expected.to validate_uniqueness_of(:key).scoped_to(:group_id) }
end
end