diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-04-06 16:32:56 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-04-06 16:32:56 +0300 |
commit | 057c0d7a5c062f3030bcc46614ef2442009002de (patch) | |
tree | e4e9f8b092500950e914955f8d257c3b443a77dd /spec/presenters | |
parent | 98a4aca6b5ce503543b0e325212265a365e64d75 (diff) |
Also track auto-cancelling in jobs, detail:
Not only tracking auto-cancelling in pipelines,
we'll also track this in jobs because pipelines
could be retried and the information would get lost
when this happened. Also erase auto-cancelling
relation for pipelines when they're retried.
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/ci/build_presenter_spec.rb | 34 | ||||
-rw-r--r-- | spec/presenters/ci/pipeline_presenter_spec.rb | 2 |
2 files changed, 15 insertions, 21 deletions
diff --git a/spec/presenters/ci/build_presenter_spec.rb b/spec/presenters/ci/build_presenter_spec.rb index a9a8df1550d..ebb599bb48c 100644 --- a/spec/presenters/ci/build_presenter_spec.rb +++ b/spec/presenters/ci/build_presenter_spec.rb @@ -58,33 +58,27 @@ describe Ci::BuildPresenter do end describe '#status_title' do - context 'when build is canceled' do + context 'when build is auto-canceled' do before do - expect(presenter).to receive(:canceled?).and_return(true) + expect(build).to receive(:auto_canceled?).and_return(true) + expect(build).to receive(:auto_canceled_by_id).and_return(1) end - context 'when pipeline is auto-canceled' do - before do - expect(pipeline).to receive(:auto_canceled?).and_return(true) - expect(pipeline).to receive(:auto_canceled_by_id).and_return(1) - end + it 'shows that the job is auto-canceled' do + status_title = presenter.status_title - it 'shows that the job is auto-canceled' do - status_title = presenter.status_title - - expect(status_title).to include('auto-canceled') - expect(status_title).to include('Pipeline #1') - end + expect(status_title).to include('auto-canceled') + expect(status_title).to include('Pipeline #1') end + end - context 'when pipeline is not auto-canceled' do - before do - expect(pipeline).to receive(:auto_canceled?).and_return(false) - end + context 'when build is not auto-canceled' do + before do + expect(build).to receive(:auto_canceled?).and_return(false) + end - it 'shows that the job is auto-canceled' do - expect(presenter.status_title).to be_nil - end + it 'does not have a status title' do + expect(presenter.status_title).to be_nil end end end diff --git a/spec/presenters/ci/pipeline_presenter_spec.rb b/spec/presenters/ci/pipeline_presenter_spec.rb index 449e45c1f4c..9134d1cc31c 100644 --- a/spec/presenters/ci/pipeline_presenter_spec.rb +++ b/spec/presenters/ci/pipeline_presenter_spec.rb @@ -46,7 +46,7 @@ describe Ci::PipelinePresenter do expect(pipeline).to receive(:auto_canceled?).and_return(false) end - it 'shows that the job is auto-canceled' do + it 'does not have a status title' do expect(presenter.status_title).to be_nil end end |