diff options
author | Rémy Coutable <remy@rymai.me> | 2017-04-27 13:13:09 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-27 13:13:09 +0000 |
commit | 39ff809980efa3f4b1ddbd66f2ae2c843a6f0e9e (patch) | |
tree | 8f7aa6b961fbea1340a5fe2f14277d7ac3a05cd8 /spec | |
parent | 19a3b49f47ef68eec12663945fa9e2163179853d (diff) | |
parent | 69f584edb4738d4de82f0301bb2ac8f6b3998814 (diff) | |
download | gitlab-ce-39ff809980efa3f4b1ddbd66f2ae2c843a6f0e9e.tar.gz |
Merge branch 'tc-make-user-master-project-by-admin' into 'master'
Make namespace owner master of project upon creation
Closes #29446
See merge request !10910
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/create_service_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 7a07ea618c0..033e6ecd18c 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -27,6 +27,22 @@ describe Projects::CreateService, '#execute', services: true do end end + context "admin creates project with other user's namespace_id" do + it 'sets the correct permissions' do + admin = create(:admin) + opts = { + name: 'GitLab', + namespace_id: user.namespace.id + } + project = create_project(admin, opts) + + expect(project).to be_persisted + expect(project.owner).to eq(user) + expect(project.team.masters).to include(user, admin) + expect(project.namespace).to eq(user.namespace) + end + end + context 'group namespace' do let(:group) do create(:group).tap do |group| |