diff options
author | Rydkin Maxim <maks.rydkin@gmail.com> | 2017-03-21 00:39:27 +0300 |
---|---|---|
committer | Rydkin Maxim <maks.rydkin@gmail.com> | 2017-04-04 21:11:25 +0300 |
commit | b49e79662e8157d7feb371737f6350dce11118e3 (patch) | |
tree | e7d0cd8fd64f6f4e2b557c288444cff1ab5c31ee /spec/services | |
parent | d2f2168b51284bee445e10d7ad399175ed51c539 (diff) | |
download | gitlab-ce-b49e79662e8157d7feb371737f6350dce11118e3.tar.gz |
refactor spec
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index c287fe42ab2..a3330367f96 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -47,31 +47,28 @@ describe Ci::CreatePipelineService, services: true do pipeline pipeline_on_previous_commit - expect(pipeline.reload) - .to have_attributes(status: 'pending', auto_canceled_by_id: nil) + expect(pipeline.reload).to have_attributes(status: 'pending', auto_canceled_by_id: nil) end it 'auto cancel pending non-HEAD pipelines' do - pending_pipeline = pipeline_on_previous_commit + pipeline_on_previous_commit pipeline - expect(pending_pipeline.reload).to have_attributes(status: 'canceled', auto_canceled_by_id: pipeline.id) + expect(pipeline_on_previous_commit.reload).to have_attributes(status: 'canceled', auto_canceled_by_id: pipeline.id) end it 'does not cancel running outdated pipelines' do - running_pipeline = pipeline_on_previous_commit - running_pipeline.run + pipeline_on_previous_commit.run execute_service - expect(running_pipeline.reload).to have_attributes(status: 'running', auto_canceled_by_id: nil) + expect(pipeline_on_previous_commit.reload).to have_attributes(status: 'running', auto_canceled_by_id: nil) end it 'cancel created outdated pipelines' do - created_pipeline = pipeline_on_previous_commit - created_pipeline.update(status: 'created') + pipeline_on_previous_commit.update(status: 'created') pipeline - expect(created_pipeline.reload).to have_attributes(status: 'canceled', auto_canceled_by_id: pipeline.id) + expect(pipeline_on_previous_commit.reload).to have_attributes(status: 'canceled', auto_canceled_by_id: pipeline.id) end it 'does not cancel pipelines from the other branches' do |