summaryrefslogtreecommitdiff
path: root/spec/services/ci/play_manual_stage_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/ci/play_manual_stage_service_spec.rb')
-rw-r--r--spec/services/ci/play_manual_stage_service_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/services/ci/play_manual_stage_service_spec.rb b/spec/services/ci/play_manual_stage_service_spec.rb
index 5d812745c7f..e2946111a13 100644
--- a/spec/services/ci/play_manual_stage_service_spec.rb
+++ b/spec/services/ci/play_manual_stage_service_spec.rb
@@ -51,8 +51,9 @@ describe Ci::PlayManualStageService, '#execute' do
context 'when user does not have permission on a specific build' do
before do
- allow_any_instance_of(Ci::Build).to receive(:play)
- .and_raise(Gitlab::Access::AccessDeniedError)
+ allow_next_instance_of(Ci::Build) do |instance|
+ allow(instance).to receive(:play).and_raise(Gitlab::Access::AccessDeniedError)
+ end
service.execute(stage)
end