diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 09:05:53 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 09:05:53 +0000 |
commit | 95793b2325f6a9add2395d89447bd0e64b870cd1 (patch) | |
tree | b16717b39c378af5cf9356dbe0eea1cad2cfc67c /spec/models/project_feature_spec.rb | |
parent | 404bb44ef7dfc2b0d4da6b946b8b96007aca4b56 (diff) | |
download | gitlab-ce-95793b2325f6a9add2395d89447bd0e64b870cd1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_feature_spec.rb')
-rw-r--r-- | spec/models/project_feature_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb index e6505bb4a51..5b448c343a0 100644 --- a/spec/models/project_feature_spec.rb +++ b/spec/models/project_feature_spec.rb @@ -228,4 +228,28 @@ describe ProjectFeature do end end end + + describe '.required_minimum_access_level' do + it 'handles reporter level' do + expect(described_class.required_minimum_access_level(:merge_requests)).to eq(Gitlab::Access::REPORTER) + end + + it 'handles guest level' do + expect(described_class.required_minimum_access_level(:issues)).to eq(Gitlab::Access::GUEST) + end + + it 'accepts ActiveModel' do + expect(described_class.required_minimum_access_level(MergeRequest)).to eq(Gitlab::Access::REPORTER) + end + + it 'accepts string' do + expect(described_class.required_minimum_access_level('merge_requests')).to eq(Gitlab::Access::REPORTER) + end + + it 'raises error if feature is invalid' do + expect do + described_class.required_minimum_access_level(:foos) + end.to raise_error + end + end end |