From 100076ecbbdf3eae361a6356ddfb55b1694e4741 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 18 Nov 2016 23:27:06 +0800 Subject: [PATCH] Add tests against two jobs having different status Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7508#note_18622469 --- spec/models/ci/pipeline_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index d013dc7b31a..2cc6d1be606 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -421,6 +421,18 @@ describe Ci::Pipeline, models: true do it { is_expected.to be_truthy } end + + %i[success failed canceled].each do |status2| + context "when there are two builds for #{status} and #{status2}" do + before do + build = %i[ci_build generic_commit_status] + create(build.sample, status, pipeline: pipeline) + create(build.sample, status2, pipeline: pipeline) + end + + it { is_expected.to be_truthy } + end + end end %i[success failed canceled].each do |status|