summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2019-04-10 09:10:37 +0000
committerDouwe Maan <douwe@gitlab.com>2019-04-10 09:10:37 +0000
commite861af409df4139e2a1c7434b1ca490710c786f1 (patch)
tree92f162543110645ec929c5e5a1ebf245a900d13b /spec
parent8036416dce7a4760bd203a291de67076385a3a2e (diff)
parent15e2b5ad0b2bdd0ccc0e5ebd47b78c0cd064dbea (diff)
downloadgitlab-ce-e861af409df4139e2a1c7434b1ca490710c786f1.tar.gz
Merge branch '47327-fix-github-project-import-visibility' into 'master'
Fix GitHub project import visibility See merge request gitlab-org/gitlab-ce!27133
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/legacy_github_import/project_creator_spec.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb b/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
index 3d4240fa4ba..8675d8691c8 100644
--- a/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb
@@ -47,12 +47,22 @@ describe Gitlab::LegacyGithubImport::ProjectCreator do
end
context 'when GitHub project is public' do
- it 'sets project visibility to public' do
+ it 'sets project visibility to namespace visibility level' do
repo.private = false
-
project = service.execute
- expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
+ expect(project.visibility_level).to eq(namespace.visibility_level)
+ end
+
+ context 'when importing into a user namespace' do
+ subject(:service) { described_class.new(repo, repo.name, user.namespace, user, github_access_token: 'asdffg') }
+
+ it 'sets project visibility to user namespace visibility level' do
+ repo.private = false
+ project = service.execute
+
+ expect(project.visibility_level).to eq(user.namespace.visibility_level)
+ end
end
end