summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-06-25 15:25:40 +0000
committerDouwe Maan <douwe@gitlab.com>2018-06-25 15:25:40 +0000
commit0edc12b35922da75dc0ad5e349bb4e68782131e0 (patch)
tree0af26d027bbaa997b83d5346abeb25489d927a09 /spec
parent51f047aaadca6908f06839a5e4ec2f3d80cebe31 (diff)
parentf012b32bd19fe800fe17339d4e0aa7b3bf3828c3 (diff)
downloadgitlab-ce-0edc12b35922da75dc0ad5e349bb4e68782131e0.tar.gz
Merge branch 'unify-delete_user_worker_spec.rb' into 'master'
Prefer `expect_next_instance_of` over `expect_any_instance_of` See merge request gitlab-org/gitlab-ce!20141
Diffstat (limited to 'spec')
-rw-r--r--spec/workers/delete_user_worker_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/workers/delete_user_worker_spec.rb b/spec/workers/delete_user_worker_spec.rb
index 36594515005..06d9e125105 100644
--- a/spec/workers/delete_user_worker_spec.rb
+++ b/spec/workers/delete_user_worker_spec.rb
@@ -5,15 +5,17 @@ describe DeleteUserWorker do
let!(:current_user) { create(:user) }
it "calls the DeleteUserWorker with the params it was given" do
- expect_any_instance_of(Users::DestroyService).to receive(:execute)
- .with(user, {})
+ expect_next_instance_of(Users::DestroyService) do |service|
+ expect(service).to receive(:execute).with(user, {})
+ end
described_class.new.perform(current_user.id, user.id)
end
it "uses symbolized keys" do
- expect_any_instance_of(Users::DestroyService).to receive(:execute)
- .with(user, test: "test")
+ expect_next_instance_of(Users::DestroyService) do |service|
+ expect(service).to receive(:execute).with(user, test: "test")
+ end
described_class.new.perform(current_user.id, user.id, "test" => "test")
end