No, the issue is that you haven't told RSpec that ContactMailer
should receive that message. The argument to double
is just a way to "name" the double for documentation purposes, as discussed in https://github.com/rspec/rspec-mocks
You actually don't need a double in this case, as you can set the expectation directly on the ContactMailer
class as follows:
ContactMailer.should_receive(:contact_mail)