diff options
author | Christiaan Van den Poel <christiaan.vandenpoel@gmail.com> | 2017-12-18 09:13:46 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-12-18 09:13:46 +0000 |
commit | 7edbc0f8c8aa53a385353740ea6767bc48df4def (patch) | |
tree | 4f99a696398283dac232a9d35e315eddba4bc69e /spec/models | |
parent | cfb8d001eb105433b52c77f212774d22e2e8bb87 (diff) | |
download | gitlab-ce-7edbc0f8c8aa53a385353740ea6767bc48df4def.tar.gz |
Fix job count in pipeline success mail
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 856e17b20bd..a1f63a2534b 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1530,4 +1530,16 @@ describe Ci::Pipeline, :mailer do expect(query_count).to eq(1) end end + + describe '#total_size' do + let!(:build_job1) { create(:ci_build, pipeline: pipeline, stage_idx: 0) } + let!(:build_job2) { create(:ci_build, pipeline: pipeline, stage_idx: 0) } + let!(:test_job_failed_and_retried) { create(:ci_build, :failed, :retried, pipeline: pipeline, stage_idx: 1) } + let!(:second_test_job) { create(:ci_build, pipeline: pipeline, stage_idx: 1) } + let!(:deploy_job) { create(:ci_build, pipeline: pipeline, stage_idx: 2) } + + it 'returns all jobs (including failed and retried)' do + expect(pipeline.total_size).to eq(5) + end + end end |