Permalink
Browse files

Add a failing test case for render :layout

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 1024c11 commit 296007744525638b142501efee57faf6ac4be20f @mikel mikel committed with josevalim Jan 29, 2010
@@ -86,6 +86,15 @@ def different_template(template_name='')
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 @@ def different_template(template_name='')
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
@@ -0,0 +1 @@
+HTML -- <%= yield %>
@@ -0,0 +1 @@
+PLAIN -- <%= yield %>

0 comments on commit 2960077

Please sign in to comment.