summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-22 19:40:03 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-22 19:40:03 +0000
commitadd00b6986c78497c18a2f48bf83f0a23c7923f8 (patch)
tree70b38743e4743ee7cf95247fd75433ddf04114e2 /spec
parent5431af8b3d4858ac72e796b42bd252d279e53f50 (diff)
parent5c8cd42bbd6a387f5e73c688615c54606810983e (diff)
downloadgitlab-ce-add00b6986c78497c18a2f48bf83f0a23c7923f8.tar.gz
Merge branch 'sh-project-import-visibility-error' into 'master'
Fix invalid visibility string comparison in project import Closes #61692 See merge request gitlab-org/gitlab-ce!28612
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb13
1 files changed, 13 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 6084dc96410..651aa600fb2 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -328,6 +328,19 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
context 'when the project has overridden params in import data' do
+ it 'handles string versions of visibility_level' do
+ # Project needs to be in a group for visibility level comparison
+ # to happen
+ group = create(:group)
+ project.group = group
+
+ project.create_import_data(data: { override_params: { visibility_level: Gitlab::VisibilityLevel::INTERNAL.to_s } })
+
+ restored_project_json
+
+ expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::INTERNAL)
+ end
+
it 'overwrites the params stored in the JSON' do
project.create_import_data(data: { override_params: { description: "Overridden" } })