aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-05-15 15:58:11 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-05-15 15:58:11 -0700
commit7994496ab4127cf15323563acd55170b9d35821a (patch)
tree8f4ac0cb163f22ecc7b4a90323cb1a164e645d7d /actionpack/test/template/text_helper_test.rb
parentdafc7343097be4b56510e693c487b284446bc1fb (diff)
parent4bb14b0daafb9b1c3d0d5c041703c9242b27adc6 (diff)
downloadrails-7994496ab4127cf15323563acd55170b9d35821a.tar.gz
rails-7994496ab4127cf15323563acd55170b9d35821a.tar.bz2
rails-7994496ab4127cf15323563acd55170b9d35821a.zip
Merge pull request #6273 from KensoDev/feature/simple_format_refactoring
Feature/simple format refactoring
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 5865b7f23c..e5cb273518 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -46,6 +46,14 @@ class TextHelperTest < ActionView::TestCase
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_with_custom_wrapper
+ assert_equal "<div></div>", simple_format(nil, {}, :wrapper_tag => "div")
+ end
+
+ def test_simple_format_with_custom_wrapper_and_multi_line_breaks
+ assert_equal "<div>We want to put a wrapper...</div>\n\n<div>...right there.</div>", simple_format("We want to put a wrapper...\n\n...right there.", {}, :wrapper_tag => "div")
+ end
+
def test_simple_format_should_not_change_the_text_passed
text = "<b>Ok</b><script>code!</script>"
text_clone = text.dup