Commit 4ea0a82b authored by Arturo Herrero's avatar Arturo Herrero

Replace allow_any_instance_of with expect_next_instance_of

parent a7f89757
......@@ -56,8 +56,9 @@ describe MergeRequests::PostMergeService do
issue = create(:issue, project: project)
allow(merge_request).to receive(:visible_closing_issues_for).and_return([issue])
allow_any_instance_of(Issues::CloseService).to receive(:execute)
.with(issue, commit: merge_request).and_raise(RuntimeError)
expect_next_instance_of(Issues::CloseService) do |service|
allow(service).to receive(:execute).with(issue, commit: merge_request).and_raise(RuntimeError)
end
expect { described_class.new(project, user).execute(merge_request) }.to raise_error(RuntimeError)
......
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