I have this in my test
Project.should_receive(:find).with(@project).and_return(@project)
but when object receive that method call two times
The new expect syntax of rspec will look like this:
for 2 times:
expect(Project).to receive(:find).twice.with(@project).and_return(@project)
for exactly n times:
expect(Project).to receive(:find).exactly(n).times.with(@project).and_return(@project)
for at least n times:
expect(Project).to receive(:msg).at_least(n).times.with(@project).and_return(@project)