diff options
Diffstat (limited to 'spec/services/ci/retry_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 526c2f39b46..3c6a99efbf8 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -64,6 +64,18 @@ RSpec.describe Ci::RetryPipelineService, '#execute' do expect(build('spinach 1')).to be_created expect(pipeline.reload).to be_running end + + it 'changes ownership of subsequent builds' do + expect(build('rspec 2').user).not_to eq(user) + expect(build('rspec 3').user).not_to eq(user) + expect(build('spinach 1').user).not_to eq(user) + + service.execute(pipeline) + + expect(build('rspec 2').user).to eq(user) + expect(build('rspec 3').user).to eq(user) + expect(build('spinach 1').user).to eq(user) + end end context 'when there is failed build present which was run on failure' do @@ -161,6 +173,16 @@ RSpec.describe Ci::RetryPipelineService, '#execute' do expect(build('rspec 2')).to be_created expect(pipeline.reload).to be_running end + + it 'changes ownership of subsequent builds' do + expect(build('staging').user).not_to eq(user) + expect(build('rspec 2').user).not_to eq(user) + + service.execute(pipeline) + + expect(build('staging').user).to eq(user) + expect(build('rspec 2').user).to eq(user) + end end end |