Search code examples
actionmailerrspec2

testing mailers in rspec


Is there no simple way to do the equivalent of response.should render_template(:foo) in a mailer spec? Here's what I want to do:

mail.should render_template(:welcome)

Is that so much to ask? Am I stuck in the dark ages of heredocs or manually reading fixtures in to match against?


Solution

  • Have you tried looking at email-spec. It doesn't have the exact syntax but it is used for testing various aspects of sending emails.