diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 03:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 03:09:27 +0300 |
commit | 77d15aff0eaa7dd8a8ce988436a502c5ab6bb55b (patch) | |
tree | 7e5a828e67a98dbb3b7eb1f73b569d15bbcf0f45 /spec/models/user_highest_role_spec.rb | |
parent | 8b5c2a4525819c6b18f422b4baa0f6568286909b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/user_highest_role_spec.rb')
-rw-r--r-- | spec/models/user_highest_role_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/user_highest_role_spec.rb b/spec/models/user_highest_role_spec.rb index 5d31dae8339..b3c795f6623 100644 --- a/spec/models/user_highest_role_spec.rb +++ b/spec/models/user_highest_role_spec.rb @@ -10,4 +10,20 @@ describe UserHighestRole do describe 'validations' do it { is_expected.to validate_inclusion_of(:highest_access_level).in_array([nil, *Gitlab::Access.all_values]) } end + + describe 'scopes' do + describe '.with_highest_access_level' do + let(:developer_access_level) { Gitlab::Access::DEVELOPER } + let!(:developer) { create(:user_highest_role, :developer) } + let!(:another_developer) { create(:user_highest_role, :developer) } + let!(:maintainer) { create(:user_highest_role, :maintainer) } + + it 'only returns entry for developer access level' do + expect(described_class.with_highest_access_level(developer_access_level)).to contain_exactly( + developer, + another_developer + ) + end + end + end end |