Use expect_next_instance_of to replace expect_any_instance_of
This commit is contained in:
parent
e446e8712c
commit
5de2035c47
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue