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
path: root/spec
diff options
context:
space:
mode:
authorChristiaan Van den Poel <christiaan.vandenpoel@gmail.com>2017-12-18 12:13:46 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-12-18 12:13:46 +0300
commit7edbc0f8c8aa53a385353740ea6767bc48df4def (patch)
tree4f99a696398283dac232a9d35e315eddba4bc69e /spec
parentcfb8d001eb105433b52c77f212774d22e2e8bb87 (diff)
Fix job count in pipeline success mail
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb4
-rw-r--r--spec/models/ci/pipeline_spec.rb12
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 888e290292b..3987cea0b4f 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -152,7 +152,7 @@ describe 'Pipeline', :js do
end
it 'shows counter in Jobs tab' do
- expect(page.find('.js-builds-counter').text).to eq(pipeline.statuses.count.to_s)
+ expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s)
end
it 'shows Pipeline tab as active' do
@@ -248,7 +248,7 @@ describe 'Pipeline', :js do
end
it 'shows counter in Jobs tab' do
- expect(page.find('.js-builds-counter').text).to eq(pipeline.statuses.count.to_s)
+ expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s)
end
it 'shows Jobs tab as active' do
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