Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-25 15:28:49 +0300
committerLin Jen-Shin <godfat@godfat.org>2018-06-25 15:28:49 +0300
commitf012b32bd19fe800fe17339d4e0aa7b3bf3828c3 (patch)
tree52e1bedfd9f32ceedb5fd0a33220575b38822d8e /spec/workers
parent901159bbae51d818cd6f643da713eee8319923da (diff)
Prefer `expect_next_instance_of` over `expect_any_instance_of`
Diffstat (limited to 'spec/workers')
-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