diff options
author | George Koltsov <koltsov.george@gmail.com> | 2019-08-29 19:49:22 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-08-29 19:49:22 +0300 |
commit | 34d142e593827df932651aaacebcd3914ba7d923 (patch) | |
tree | 885fb2888a8c2883fee3fe26a752137c3f737b26 /spec/lib | |
parent | de651ce8020693ee0d6cef0f8b7eeae59c31afde (diff) |
Allow project feature permissions to be overridden during import
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index d6e1fbaa979..0aef4887c75 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -396,6 +396,27 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do expect(project.lfs_enabled).to be_falsey end + + it 'overrides project feature access levels' do + access_level_keys = project.project_feature.attributes.keys.select { |a| a =~ /_access_level/ } + + # `pages_access_level` is not included, since it is not available in the public API + # and has a dependency on project's visibility level + # see ProjectFeature model + access_level_keys.delete('pages_access_level') + + disabled_access_levels = Hash[access_level_keys.collect { |item| [item, 'disabled'] }] + + project.create_import_data(data: { override_params: disabled_access_levels }) + + restored_project_json + + aggregate_failures do + access_level_keys.each do |key| + expect(project.public_send(key)).to eq(ProjectFeature::DISABLED) + end + end + end end context 'with a project that has a group' do |