summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-05-22 19:40:03 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-06-10 07:15:11 +0000
commita9013d2e22f3f569067af6da2b75747541db6ab3 (patch)
treedafcb3b9ca5631dfb083b81455b776d6eea4dd4a /spec/lib
parent7e47a8e6f5db65ebfcfb1db616ebbfbc7737e323 (diff)
downloadgitlab-ce-a9013d2e22f3f569067af6da2b75747541db6ab3.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 (cherry picked from commit add00b6986c78497c18a2f48bf83f0a23c7923f8) 5c8cd42b Fix invalid visibility string comparison in project import
Diffstat (limited to 'spec/lib')
-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 9d2b69ea798..ca46006ea58 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -348,6 +348,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" } })