Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/projects/create_service_spec.rb')
-rw-r--r--spec/services/projects/create_service_spec.rb35
1 files changed, 14 insertions, 21 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb
index 9c8aeb5cf7b..f42ab198a04 100644
--- a/spec/services/projects/create_service_spec.rb
+++ b/spec/services/projects/create_service_spec.rb
@@ -145,6 +145,20 @@ RSpec.describe Projects::CreateService, '#execute' do
end
end
end
+
+ context 'when the passed in namespace is for a bot user' do
+ let(:bot_user) { create(:user, :project_bot) }
+ let(:opts) do
+ { name: project_name, namespace_id: bot_user.namespace.id }
+ end
+
+ it 'raises an error' do
+ project = create_project(bot_user, opts)
+
+ expect(project.errors.errors.length).to eq 1
+ expect(project.errors.messages[:namespace].first).to eq(("is not valid"))
+ end
+ end
end
describe 'after create actions' do
@@ -908,27 +922,6 @@ RSpec.describe Projects::CreateService, '#execute' do
end
end
- it_behaves_like 'measurable service' do
- before do
- opts.merge!(
- current_user: user,
- path: 'foo'
- )
- end
-
- let(:base_log_data) do
- {
- class: Projects::CreateService.name,
- current_user: user.name,
- project_full_path: "#{user.namespace.full_path}/#{opts[:path]}"
- }
- end
-
- after do
- create_project(user, opts)
- end
- end
-
context 'with specialized project_authorization workers' do
let_it_be(:other_user) { create(:user) }
let_it_be(:group) { create(:group) }