Permalink
Browse files

ActionView::Helpers::TextHelper#simple_format should not change the t…

…ext in place. Now it duplicates it.
  • Loading branch information...
1 parent 3a4dc9d commit f0034c75d5a9bc5065652c2fedf39250a6f1847b Casebook Developer committed Aug 4, 2011
@@ -256,7 +256,7 @@ def word_wrap(text, *args)
# # => "<p><span>I'm allowed!</span> It's true.</p>"
def simple_format(text, html_options={}, options={})
text = '' if text.nil?
- text = text.dup if text.frozen?
+ text = text.dup
start_tag = tag('p', html_options, true)
text = sanitize(text) unless options[:sanitize] == false
text = text.to_str
@@ -48,10 +48,10 @@ def test_simple_format_should_not_sanitize_input_when_sanitize_option_is_false
assert_equal "<p><b> test with unsafe string </b><script>code!</script></p>", simple_format("<b> test with unsafe string </b><script>code!</script>", {}, :sanitize => false)
end
- def test_simple_format_should_not_change_the_frozen_text_passed
+ def test_simple_format_should_not_change_the_text_passed
text = "<b>Ok</b><script>code!</script>"
text_clone = text.dup
- simple_format(text.freeze)
+ simple_format(text)
assert_equal text_clone, text
end

0 comments on commit f0034c7

Please sign in to comment.