aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-01-29 19:31:24 +1100
committerJosé Valim <jose.valim@gmail.com>2010-01-29 17:51:05 +0100
commit1024c11f3c6218dfdbe8ac4be41671248c21591c (patch)
tree2afd2b4b9dd7ce94377b63789bb931789dad2f9f /actionmailer/test/base_test.rb
parent8031a53abd699ef3d1db01dc1783440c7229b1cf (diff)
downloadrails-1024c11f3c6218dfdbe8ac4be41671248c21591c.tar.gz
rails-1024c11f3c6218dfdbe8ac4be41671248c21591c.tar.bz2
rails-1024c11f3c6218dfdbe8ac4be41671248c21591c.zip
Added tests for rendering different template for new API
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 03e3f81acd..b7a8bc73de 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -78,6 +78,14 @@ class BaseTest < ActiveSupport::TestCase
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 @@ class BaseTest < ActiveSupport::TestCase
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