diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-16 15:09:52 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-16 15:09:52 +0300 |
commit | abb5f765c1e1affe0e132c86811e356e4a7008c9 (patch) | |
tree | 815fbaa397217d82d82cae996498617494aee8e2 /spec/models/ci/pipeline_spec.rb | |
parent | 8c5a3ffe9d29767eaf2e75038056efe29579b7bf (diff) | |
parent | 7d5b8993f47f02488cb37811719193d4ecb45e0a (diff) |
Merge branch '27376-cache-default-branch-pipeline-on-project' into 'master'
Speed up several project lists
See merge request !9903
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 9962c987110..4a664e4fae2 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1018,6 +1018,19 @@ describe Ci::Pipeline, models: true do end end + describe '#update_status' do + let(:pipeline) { create(:ci_pipeline, sha: '123456') } + + it 'updates the cached status' do + fake_status = double + # after updating the status, the status is set to `skipped` for this pipeline's builds + expect(Ci::PipelineStatus).to receive(:new).with(pipeline.project, sha: '123456', status: 'skipped').and_return(fake_status) + expect(fake_status).to receive(:store_in_cache_if_needed) + + pipeline.update_status + end + end + describe 'notifications when pipeline success or failed' do let(:project) { create(:project, :repository) } |