From d92668a05bf35995b4b93069269084ee5db93484 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 25 Jul 2015 16:42:28 -0400 Subject: Only create :admin user in the one test where it's used --- spec/services/projects/create_service_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 97b206c9854..3e3d85db858 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -4,7 +4,6 @@ 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 @@ -75,7 +74,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 -- cgit v1.2.1 From 88aed4096274db4b2cf61c0afaa7c1df5c5f5b33 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 25 Jul 2015 16:43:18 -0400 Subject: Create project services on Project creation --- spec/services/projects/create_service_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec') diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 3e3d85db858..66cdfd5d758 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -10,6 +10,13 @@ describe Projects::CreateService do } 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) -- cgit v1.2.1