What are the best practices and tools to test email-sending using rspec with Rails?
For instance, how do I test that an email has been sent or what should I test to have efficient testing and acceptable coverage.
If you guys need an example, how would I go and test this:
class UserMailer < ActionMailer::Base
def jobdesc_has_been_reviewed(user, title)
@body[:title] = title
@body[:jobdesc] = jobdesc
@body[:url] = "http://" + user.account.subdomain + "." + Constants::SITE_URL + "/jobdescs/#{jobdesc.id}"
end
end
email-spec looks like a good library
http://github.com/bmabey/email-spec
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With