Automatically preserve textareas generated via Rails helpers.
This commit is contained in:
parent
cf4013f868
commit
d3ba044529
|
@ -61,6 +61,12 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
|
|||
end
|
||||
alias_method :form_tag_without_haml, :form_tag
|
||||
alias_method :form_tag, :form_tag_with_haml
|
||||
|
||||
def text_area_tag_with_haml(*args)
|
||||
preserve text_area_tag_without_haml(*args)
|
||||
end
|
||||
alias_method :text_area_tag_without_haml, :text_area_tag
|
||||
alias_method :text_area_tag, :text_area_tag_with_haml
|
||||
end
|
||||
|
||||
module FormHelper
|
||||
|
|
|
@ -86,6 +86,11 @@ class HelperTest < Test::Unit::TestCase
|
|||
assert_equal(should_be, result)
|
||||
end
|
||||
|
||||
def test_text_area_tag
|
||||
assert_equal("<textarea id=\"body\" name=\"body\">Foo
Bar
 Baz
 Boom</textarea>\n",
|
||||
render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view))
|
||||
end
|
||||
|
||||
def test_capture_haml
|
||||
assert_equal("\"<p>13</p>\\n\"\n", render("- foo = capture_haml(13) do |a|\n %p= a\n= foo.dump"))
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue