diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 00:09:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-02 00:09:22 +0300 |
commit | 1e0d9b713469904253f2452d8d34922d316a766a (patch) | |
tree | 11f46c168733068698e025bf440fc37afecb4bfc /spec/models/user_spec.rb | |
parent | 1769b59b9fd05325e3016b1a53a82ae6cf56adb5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 9498aa75289..ac92311e132 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1790,28 +1790,14 @@ RSpec.describe User do context 'when user has running CI pipelines' do let(:service) { double } + let(:pipelines) { build_list(:ci_pipeline, 3, :running) } - context 'with abort_user_pipelines_on_block feature enabled' do - let(:pipelines) { build_list(:ci_pipeline, 3, :running) } + it 'aborts all running pipelines and related jobs' do + expect(user).to receive(:pipelines).and_return(pipelines) + expect(Ci::AbortPipelinesService).to receive(:new).and_return(service) + expect(service).to receive(:execute).with(pipelines) - it 'aborts all running pipelines and related jobs' do - stub_feature_flags(abort_user_pipelines_on_block: true) - expect(user).to receive(:pipelines).and_return(pipelines) - expect(Ci::AbortPipelinesService).to receive(:new).and_return(service) - expect(service).to receive(:execute).with(pipelines) - - user.block - end - end - - context 'with abort_user_pipelines_on_block feature disabled' do - it 'cancels all running pipelines and related jobs' do - stub_feature_flags(abort_user_pipelines_on_block: false) - expect(Ci::CancelUserPipelinesService).to receive(:new).and_return(service) - expect(service).to receive(:execute).with(user) - - user.block - end + user.block end end |