Commit e1cdc26e authored by Valery Sizov's avatar Valery Sizov

Merge branch 'rs-dev-issue-306' into 'master'

Create project services on Project creation

Closes internal https://dev.gitlab.org/gitlab/gitlab-ee/issues/306#note_53354

See merge request !1045
parents 8be3d120 88aed409
......@@ -85,6 +85,8 @@ module Projects
@project.create_wiki if @project.wiki_enabled?
@project.build_missing_services
event_service.create_project(@project, current_user)
system_hook_service.execute_hooks_for(@project, :create)
......
......@@ -4,13 +4,19 @@ describe Projects::CreateService do
describe :create_by_user do
before do
@user = create :user
@admin = create :user, admin: true
@opts = {
name: "GitLab",
namespace: @user.namespace
}
end
it 'creates services on Project creation' do
project = create_project(@user, @opts)
project.reload
expect(project.services).not_to be_empty
end
context 'user namespace' do
before do
@project = create_project(@user, @opts)
......@@ -75,7 +81,9 @@ describe Projects::CreateService do
end
it 'should allow a restricted visibility level for admins' do
project = create_project(@admin, @opts)
admin = create(:admin)
project = create_project(admin, @opts)
expect(project.errors.any?).to be(false)
expect(project.saved?).to be(true)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment