summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-21 22:54:11 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-06-21 23:02:36 +0800
commit5de2035c4774ef5d86450221918615acb0b986cf (patch)
treefc10495bdc1aec1f9ace94ef8f1925805e516e97
parente446e8712cd690981b48bc54ae1c20b7f4d3f99e (diff)
downloadgitlab-ce-unify-destroy_service_spec.rb.tar.gz
Use expect_next_instance_of to replace expect_any_instance_ofunify-destroy_service_spec.rb
-rw-r--r--spec/services/users/destroy_service_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb
index 76f1e625fda..f82d4b483e7 100644
--- a/spec/services/users/destroy_service_spec.rb
+++ b/spec/services/users/destroy_service_spec.rb
@@ -19,7 +19,9 @@ describe Users::DestroyService do
end
it 'will delete the project' do
- expect_any_instance_of(Projects::DestroyService).to receive(:execute).once
+ expect_next_instance_of(Projects::DestroyService) do |destroy_service|
+ expect(destroy_service).to receive(:execute).once
+ end
service.execute(user)
end
@@ -32,7 +34,9 @@ describe Users::DestroyService do
end
it 'destroys a project in pending_delete' do
- expect_any_instance_of(Projects::DestroyService).to receive(:execute).once
+ expect_next_instance_of(Projects::DestroyService) do |destroy_service|
+ expect(destroy_service).to receive(:execute).once
+ end
service.execute(user)