I\'d like to test if an email is delivered if I call a controller method with :post. I\'ll use email_spec so I tried this snipped here: http://rubydoc.info/gems/email_spec/1
This is way how to test that Mailer is called with right arguments. You can use this code in feature, controller or mailer spec:
delivery = double expect(delivery).to receive(:deliver_now).with(no_args) expect(ReservationMailer).to receive(:confirm_email) .with('reservation') .and_return(delivery)