Commit 0edc12b3 authored by Douwe Maan's avatar Douwe Maan

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
parents 51f047aa f012b32b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment