aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-01-29 13:00:12 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-29 17:51:05 +0100
commit296007744525638b142501efee57faf6ac4be20f (patch)
treea7aafafe17b666592cb85a6420ee26c454e29583 /actionmailer/test/base_test.rb
parent1024c11f3c6218dfdbe8ac4be41671248c21591c (diff)
downloadrails-296007744525638b142501efee57faf6ac4be20f.tar.gz
rails-296007744525638b142501efee57faf6ac4be20f.tar.bz2
rails-296007744525638b142501efee57faf6ac4be20f.zip
Add a failing test case for render :layout
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index b7a8bc73de..2d3f8ac13a 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -86,6 +86,15 @@ class BaseTest < ActiveSupport::TestCase
end
end
+ def different_layout(layout_name='')
+ mail do |format|
+ format.text {
+ render :layout => layout_name
+ }
+ format.html { render :layout => layout_name }
+ end
+ end
+
end
test "method call to mail does not raise error" do
@@ -469,6 +478,12 @@ class BaseTest < ActiveSupport::TestCase
assert_equal("TEXT Explicit Multipart Templates", mail.text_part.body.decoded)
end
+ test "that you can specify a different layout" do
+ mail = BaseMailer.different_layout('different_layout')
+ assert_equal("HTML -- HTML", mail.html_part.body.decoded)
+ assert_equal("PLAIN -- PLAIN", mail.text_part.body.decoded)
+ end
+
protected
# Execute the block setting the given values and restoring old values after