summaryrefslogtreecommitdiff
path: root/spec/support/helpers/project_helpers.rb
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2019-11-08 14:47:50 +0800
committerMark Chao <mchao@gitlab.com>2019-11-25 09:06:22 +0800
commit3f5c5ae10cb160e7156fa8c5f7f0b04c8fcb5c52 (patch)
tree355fe475396093cd971e6edb6dba6e7d0257d0ed /spec/support/helpers/project_helpers.rb
parent26121e3bcdc6b4da8d89ae49af42232b5baccb6d (diff)
downloadgitlab-ce-3f5c5ae10cb160e7156fa8c5f7f0b04c8fcb5c52.tar.gz
ES: update permission spec table
Remove impossible cases due to private project's features can only be private or disabled. Fix spec due to sidekiq indexing not triggered. Update guest use cases: some features has additional constraint that "Guest users are able to perform action on public/internal projects, but not private ones."
Diffstat (limited to 'spec/support/helpers/project_helpers.rb')
-rw-r--r--spec/support/helpers/project_helpers.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/support/helpers/project_helpers.rb b/spec/support/helpers/project_helpers.rb
index 61056b47aed..3cc84d935d2 100644
--- a/spec/support/helpers/project_helpers.rb
+++ b/spec/support/helpers/project_helpers.rb
@@ -16,10 +16,10 @@ module ProjectHelpers
end
def update_feature_access_level(project, access_level)
- project.update!(
- repository_access_level: access_level,
- merge_requests_access_level: access_level,
- builds_access_level: access_level
- )
+ features = ProjectFeature::FEATURES.dup
+ features.delete(:pages)
+ params = features.each_with_object({}) { |feature, h| h["#{feature}_access_level"] = access_level }
+
+ project.update!(params)
end
end