Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 480
steve Avatar asked Apr 22 '11 23:04

steve


1 Answers

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.

like image 189
Wes Avatar answered Nov 02 '22 08:11

Wes