diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 09:09:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 09:09:06 +0000 |
commit | d87918510a866a5fcbbc2f899ad65c6938ebf5f5 (patch) | |
tree | 3c864a44f28dc17bcba2bcea30e49e0c08bd0582 /spec/lib | |
parent | fa478f189009649b115136957e2da30d760fe391 (diff) | |
download | gitlab-ce-d87918510a866a5fcbbc2f899ad65c6938ebf5f5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb | 19 | ||||
-rw-r--r-- | spec/lib/gitlab/diff/highlight_cache_spec.rb | 7 |
2 files changed, 19 insertions, 7 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) diff --git a/spec/lib/gitlab/diff/highlight_cache_spec.rb b/spec/lib/gitlab/diff/highlight_cache_spec.rb index c1ec97ae88c..218c393c409 100644 --- a/spec/lib/gitlab/diff/highlight_cache_spec.rb +++ b/spec/lib/gitlab/diff/highlight_cache_spec.rb @@ -101,13 +101,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do let(:paths) { merge_request.diffs.raw_diff_files.select(&:text?).map(&:file_path) } end - it 'updates memory usage metrics' do - expect(described_class.gitlab_redis_diff_caching_memory_usage_bytes) - .to receive(:observe).and_call_original - - cache.send(:write_to_redis_hash, diff_hash) - end - context 'different diff_collections for the same diffable' do before do cache.write_if_empty |