diff options
-rw-r--r-- | spec/services/ci/ensure_stage_service_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/services/ci/ensure_stage_service_spec.rb b/spec/services/ci/ensure_stage_service_spec.rb index 47ba1e74c15..fa3baf3236a 100644 --- a/spec/services/ci/ensure_stage_service_spec.rb +++ b/spec/services/ci/ensure_stage_service_spec.rb @@ -10,27 +10,27 @@ describe Ci::EnsureStageService, '#execute' do let(:service) { described_class.new(project, user) } context 'when build has a stage assigned' do - it 'does not create a new stage' do - job.assign_attributes(stage_id: stage.id) + it 'does not create a new stage' do + job.assign_attributes(stage_id: stage.id) - expect { service.execute(job) }.not_to change { Ci::Stage.count } - end + expect { service.execute(job) }.not_to change { Ci::Stage.count } + end end context 'when build does not have a stage assigned' do - it 'creates a new stage' do - job.assign_attributes(stage_id: nil, stage: 'test') + it 'creates a new stage' do + job.assign_attributes(stage_id: nil, stage: 'test') - expect { service.execute(job) }.to change { Ci::Stage.count }.by(1) - end + expect { service.execute(job) }.to change { Ci::Stage.count }.by(1) + end end context 'when build is invalid' do - it 'does not create a new stage' do - job.assign_attributes(stage_id: nil, ref: nil) + it 'does not create a new stage' do + job.assign_attributes(stage_id: nil, ref: nil) - expect { service.execute(job) }.not_to change { Ci::Stage.count } - end + expect { service.execute(job) }.not_to change { Ci::Stage.count } + end end context 'when new stage can not be created because of an exception' do |