diff options
author | Robert Speicher <robert@gitlab.com> | 2018-06-21 23:26:19 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-06-21 23:26:19 +0000 |
commit | 0ea5d6645c9919b63ebb44fb37ea402fd40609ac (patch) | |
tree | f05e73be7c36f87c433175f143659b601e81b588 | |
parent | 3a9839a83b43b05a963b34b54ae894feb1443fa7 (diff) | |
parent | 5de2035c4774ef5d86450221918615acb0b986cf (diff) | |
download | gitlab-ce-0ea5d6645c9919b63ebb44fb37ea402fd40609ac.tar.gz |
Merge branch 'unify-destroy_service_spec.rb' into 'master'
Use expect_next_instance_of to replace expect_any_instance_of
See merge request gitlab-org/gitlab-ce!20072
-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) |