diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-09 00:28:42 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-09 10:06:14 +0200 |
commit | 0919c0dbca3df02f5cfff7dde4f61b85ef16d886 (patch) | |
tree | ad022ed8ac2b7bf94eeff03c365c3654da621426 /actionpack/test | |
parent | f48aa14bf43fb103e5d128151061549ba6bb8c23 (diff) | |
download | rails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.tar.gz rails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.tar.bz2 rails-0919c0dbca3df02f5cfff7dde4f61b85ef16d886.zip |
Removed textilize, textilize_without_paragraph and markdown helpers
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/text_helper_test.rb | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb index 64f1d46413..17fc8b6edd 100644 --- a/actionpack/test/template/text_helper_test.rb +++ b/actionpack/test/template/text_helper_test.rb @@ -1,17 +1,6 @@ # encoding: us-ascii require 'abstract_unit' require 'testing_sandbox' -begin - require 'redcloth' -rescue LoadError - $stderr.puts "Skipping textilize tests. `gem install RedCloth` to enable." -end - -begin - require 'bluecloth' -rescue LoadError - $stderr.puts "Skipping markdown tests. 'gem install bluecloth' to enable." -end class TextHelperTest < ActionView::TestCase tests ActionView::Helpers::TextHelper @@ -665,101 +654,4 @@ class TextHelperTest < ActionView::TestCase assert_equal("red", cycle("red", "blue")) assert_equal(%w{Specialized Fuji Giant}, @cycles) end - - # TODO test textilize_without_paragraph and markdown - if defined? RedCloth - def test_textilize_should_be_html_safe - assert textilize("*This is Textile!* Rejoice!").html_safe? - 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_should_sanitize_unsafe_input - assert_equal("<p>This is worded <strong>strongly</strong></p>", textilize("This is worded <strong>strongly</strong><script>code!</script>")) - end - - def test_textilize_should_not_sanitize_input_if_safe_option - assert_equal("<p>This is worded <strong>strongly</strong><script>code!</script></p>", textilize("This is worded <strong>strongly</strong><script>code!</script>", :safe)) - end - - def test_textilize_should_not_sanitize_safe_input - assert_equal("<p>This is worded <strong>strongly</strong><script>code!</script></p>", textilize("This is worded <strong>strongly</strong><script>code!</script>".html_safe)) - 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 - - def test_textilize_without_paragraph_should_be_html_safe - textilize_without_paragraph("*This is Textile!* Rejoice!").html_safe? - end - - def test_textilize_without_paragraph - assert_equal("<strong>This is Textile!</strong> Rejoice!", textilize_without_paragraph("*This is Textile!* Rejoice!")) - end - - def test_textilize_without_paragraph_with_blank - assert_equal("", textilize_without_paragraph("")) - end - - def test_textilize_without_paragraph_with_options - assert_equal("This is worded <strong>strongly</strong>", textilize_without_paragraph("This is worded <strong>strongly</strong>", :filter_html)) - end - - def test_textilize_without_paragraph_should_sanitize_unsafe_input - assert_equal("This is worded <strong>strongly</strong>", textilize_without_paragraph("This is worded <strong>strongly</strong><script>code!</script>")) - end - - def test_textilize_without_paragraph_should_not_sanitize_input_if_safe_option - assert_equal("This is worded <strong>strongly</strong><script>code!</script>", textilize_without_paragraph("This is worded <strong>strongly</strong><script>code!</script>", :safe)) - end - - def test_textilize_without_paragraph_should_not_sanitize_safe_input - assert_equal("This is worded <strong>strongly</strong><script>code!</script>", textilize_without_paragraph("This is worded <strong>strongly</strong><script>code!</script>".html_safe)) - end - - def test_textilize_without_paragraph_with_hard_breaks - assert_equal("This is one scary world.<br />\n True.", textilize_without_paragraph("This is one scary world.\n True.")) - end - end - - if defined? BlueCloth - def test_markdown_should_be_html_safe - assert markdown("We are using __Markdown__ now!").html_safe? - end - - def test_markdown - assert_equal("<p>We are using <strong>Markdown</strong> now!</p>", markdown("We are using __Markdown__ now!")) - end - - def test_markdown_with_blank - assert_equal("", markdown("")) - end - - def test_markdown_should_sanitize_unsafe_input - assert_equal("<p>This is worded <strong>strongly</strong></p>", markdown("This is worded <strong>strongly</strong><script>code!</script>")) - end - - def test_markdown_should_not_sanitize_input_if_safe_option - assert_equal("<p>This is worded <strong>strongly</strong><script>code!</script></p>", markdown("This is worded <strong>strongly</strong><script>code!</script>", :safe)) - end - - def test_markdown_should_not_sanitize_safe_input - assert_equal("<p>This is worded <strong>strongly</strong><script>code!</script></p>", markdown("This is worded <strong>strongly</strong><script>code!</script>".html_safe)) - end - - def test_markdown_with_hard_breaks - assert_equal("<p>This is one scary world.</p>\n\n<p>True.</p>", markdown("This is one scary world.\n\nTrue.")) - end - end end |