提交 1024c11f 编写于 作者: M Mikel Lindsaar 提交者: José Valim

Added tests for rendering different template for new API

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 8031a53a
......@@ -78,6 +78,14 @@ def custom_block(include_html=false)
format.html{ render "welcome" } if include_html
end
end
def different_template(template_name='')
mail do |format|
format.text { render :template => template_name }
format.html { render :template => template_name }
end
end
end
test "method call to mail does not raise error" do
......@@ -454,6 +462,12 @@ def custom_block(include_html=false)
mail = BaseMailer.plain_text_only
assert_equal('text/plain', mail.mime_type)
end
test "that you can specify a different template" do
mail = BaseMailer.different_template('explicit_multipart_templates')
assert_equal("HTML Explicit Multipart Templates", mail.html_part.body.decoded)
assert_equal("TEXT Explicit Multipart Templates", mail.text_part.body.decoded)
end
protected
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册