Commit 5de2035c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Use expect_next_instance_of to replace expect_any_instance_of

parent e446e871
......@@ -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)
......
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