diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-06-21 17:54:11 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-06-21 18:02:36 +0300 |
commit | 5de2035c4774ef5d86450221918615acb0b986cf (patch) | |
tree | fc10495bdc1aec1f9ace94ef8f1925805e516e97 /spec/services | |
parent | e446e8712cd690981b48bc54ae1c20b7f4d3f99e (diff) |
Use expect_next_instance_of to replace expect_any_instance_of
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/users/destroy_service_spec.rb | 8 |
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) |