diff options
author | rizwanreza <rizwanreza@gmail.com> | 2009-08-09 05:55:25 +0300 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 16:41:09 +0100 |
commit | 7dbb2b6f83c5a1a5f4ef0a97fee5322957977306 (patch) | |
tree | 64343e01585bf82677c9e010db449a9cd772ec21 /actionpack/test/template | |
parent | 7d254b5d74144a1e217125e7be21882ce380a3f8 (diff) | |
download | rails-7dbb2b6f83c5a1a5f4ef0a97fee5322957977306.tar.gz rails-7dbb2b6f83c5a1a5f4ef0a97fee5322957977306.tar.bz2 rails-7dbb2b6f83c5a1a5f4ef0a97fee5322957977306.zip |
Support passing Redcloth options via textilize helper [#2973 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 706b5085f4..b7823b9394 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -1,5 +1,6 @@ require 'abstract_unit' require 'testing_sandbox' +require 'redcloth' class TextHelperTest < ActionView::TestCase tests ActionView::Helpers::TextHelper @@ -528,4 +529,20 @@ class TextHelperTest < ActionView::TestCase assert_equal("red", cycle("red", "blue")) assert_equal(%w{Specialized Fuji Giant}, @cycles) end + + def test_textilize + assert_equal("<p><strong>This is Textile!</strong> Rejoice!</p>", textilize("*This is Textile!* Rejoice!")) + end + + def test_textilize_with_blank + assert_equal("", textilize("")) + end + + def test_textilize_with_options + assert_equal("<p>This is worded <strong>strongly</strong></p>", textilize("This is worded <strong>strongly</strong>", :filter_html)) + end + + def test_textilize_with_hard_breaks + assert_equal("<p>This is one scary world.<br />\n True.</p>", textilize("This is one scary world.\n True.")) + end end |