O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Mailers

Testing Rails mailers involves two separate bits of functionality: specifying whether the email gets sent as a result of some action, and specifying the contents of that email. Specifying whether the email gets sent often starts as part of a controller or integration test, while specifying the content has a lot in common with view testing. The somewhat indirect nature of the Rails ActionMailer makes testing email less obvious than it might be, but it’s not hard. We’ll also look at a third-party library that makes email testing easier.

Let’s say, for example purposes, that we want to send an email in our project system when a task is marked as complete. We don’t have a user model yet (we’ll talk about users in this system when ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required