From d9000184e5e8a63e0c24fe264e864fc27f6515c4 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 15 Dec 2016 18:52:36 +0800 Subject: Add explicit status test, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20058993 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059060 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059357 --- spec/models/ci/pipeline_spec.rb | 2 ++ spec/models/commit_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index d06c30a891c..52dd41065e9 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -426,6 +426,7 @@ describe Ci::Pipeline, models: true do it 'returns the latest status for the same ref and different sha' do expect(latest_status).to eq(described_class.latest.status) + expect(latest_status).to eq('failed') end end @@ -434,6 +435,7 @@ describe Ci::Pipeline, models: true do it 'returns the latest status for ref and different sha' do expect(latest_status).to eq(described_class.latest_status('ref')) + expect(latest_status).to eq('failed') end end end diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 9aac2abfb27..74b50d2908d 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -225,6 +225,7 @@ eos it 'gives compound status from latest pipelines' do expect(commit.status).to eq(Ci::Pipeline.latest_status) + expect(commit.status).to eq('pending') end end @@ -252,6 +253,7 @@ eos it 'gives compound status from latest pipelines if ref is nil' do expect(commit.status(nil)).to eq(Ci::Pipeline.latest_status) + expect(commit.status(nil)).to eq('failed') end end end -- cgit v1.2.1