diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 12:09:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 12:09:06 +0300 |
commit | d87918510a866a5fcbbc2f899ad65c6938ebf5f5 (patch) | |
tree | 3c864a44f28dc17bcba2bcea30e49e0c08bd0582 /spec/lib/gitlab/database_importers | |
parent | fa478f189009649b115136957e2da30d760fe391 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/database_importers')
-rw-r--r-- | spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb index e425acd4ae5..8311f3f4539 100644 --- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb +++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb @@ -125,6 +125,25 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do expect(application_setting.self_monitoring_project_id).to eq(project.id) end + it 'creates an environment for the project' do + expect(project.default_environment.name).to eq('production') + end + + context 'when the environment creation fails' do + let(:environment) { build(:environment, name: 'production') } + + it 'returns error' do + allow(Environment).to receive(:new).and_return(environment) + allow(environment).to receive(:save).and_return(false) + + expect(result).to eq( + status: :error, + message: 'Could not create environment', + last_step: :create_environment + ) + end + end + it 'returns error when saving project ID fails' do allow(application_setting).to receive(:update).and_call_original allow(application_setting).to receive(:update) |