Added feature test for mailer #2369

This commit is contained in:
Priit Tark 2015-08-25 22:09:15 +03:00
parent 032cff3cf3
commit d11aee7e95
5 changed files with 52 additions and 14 deletions

View file

@ -1,10 +1,3 @@
class MailTemplate < ActiveRecord::Base
validates :name, :subject, :from, :body, :text_body, presence: true
def to_html(body)
template = Erubis::Eruby.new(content, escape: true)
template_result = template.result(context)
Sanitize.clean(RDiscount.new(template_result).to_html.encode('UTF-8', undef: :replace), Sanitize::Config::RELAXED)
end
end