summaryrefslogtreecommitdiff
path: root/spec/models/project_feature_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
commit0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch)
tree4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/models/project_feature_spec.rb
parent744144d28e3e7fddc117924fef88de5d9674fe4c (diff)
downloadgitlab-ce-0653e08efd039a5905f3fa4f6e9cef9f5d2f799c.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/models/project_feature_spec.rb')
-rw-r--r--spec/models/project_feature_spec.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb
index 5f720f8c4f8..75e43ed9a67 100644
--- a/spec/models/project_feature_spec.rb
+++ b/spec/models/project_feature_spec.rb
@@ -41,18 +41,15 @@ RSpec.describe ProjectFeature do
end
end
- context 'public features' do
- features = ProjectFeature::FEATURES - %i(pages)
+ it_behaves_like 'access level validation', ProjectFeature::FEATURES - %i(pages) do
+ let(:container_features) { project.project_feature }
+ end
- features.each do |feature|
- it "does not allow public access level for #{feature}" do
- project_feature = project.project_feature
- field = "#{feature}_access_level".to_sym
- project_feature.update_attribute(field, ProjectFeature::PUBLIC)
+ it 'allows public access level for :pages feature' do
+ project_feature = project.project_feature
+ project_feature.pages_access_level = ProjectFeature::PUBLIC
- expect(project_feature.valid?).to be_falsy, "#{field} failed"
- end
- end
+ expect(project_feature.valid?).to be_truthy
end
describe 'default pages access level' do