I am using the Postmark gem for rails and writing Rspecs tests to make sure the emails are actually being sent when the form is valid.
I want to check that ActionMailer::Base.deliveries.last.to matches what I put in the contact form I'd like to test.
However, ActionMailer::Base.deliveries is always an empty array. Even in production, after an email is successfully sent (and received on the other end), the array is still empty when observed with rails c production
.
What am I missing? How can I verify that the email has been sent in my tests?