mirror of https://github.com/rails/rails
Add a failing test case for render :layout
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
1024c11f3c
commit
2960077445
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
HTML
|
|
@ -0,0 +1 @@
|
|||
PLAIN
|
|
@ -0,0 +1 @@
|
|||
body_text
|
|
@ -0,0 +1 @@
|
|||
HTML -- <%= yield %>
|
|
@ -0,0 +1 @@
|
|||
PLAIN -- <%= yield %>
|
Loading…
Reference in New Issue