[rspec-users] [rspec-rails] Mailer tests should be similar to Controller tests

Paulo Luis Franchini Casaretto pcasaretto at gmail.com
Tue Mar 27 00:20:33 UTC 2012



Hey,

When I'm testing a controller, I basically test three things.
Does it assign the variables the view needs?
Does it render the right template?
Does it do whatever the action is supposed to do?
And when testing mailers I feel it should be basically the same.
Does it assign the variables the view needs?
Does it render the right template?
Does it set the right headers?
I don't want to test the actual mail object, the same way I don't want to 
test the views in controller tests.
On the other hand, the mail object IS the output of the mailer, so I don't 
know.
What do you guys think about this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120326/fa23c73d/attachment.html>


More information about the rspec-users mailing list