From 4bb14b0daafb9b1c3d0d5c041703c9242b27adc6 Mon Sep 17 00:00:00 2001 From: Avi Tzurel Date: Mon, 14 May 2012 01:15:46 +0300 Subject: Added the wrapper tag option to simple_format --- actionpack/test/template/text_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/template/text_helper_test.rb') 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 "

test with unsafe string

", simple_format(" test with unsafe string ", {}, :sanitize => false) end + def test_simple_format_with_custom_wrapper + assert_equal "
", simple_format(nil, {}, :wrapper_tag => "div") + end + + def test_simple_format_with_custom_wrapper_and_multi_line_breaks + assert_equal "
We want to put a wrapper...
\n\n
...right there.
", 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 = "Ok" text_clone = text.dup -- cgit v1.2.3