From 0919c0dbca3df02f5cfff7dde4f61b85ef16d886 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 9 Jun 2010 00:28:42 -0300 Subject: Removed textilize, textilize_without_paragraph and markdown helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/test/template/text_helper_test.rb | 108 --------------------------- 1 file changed, 108 deletions(-) (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 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("

This is Textile! Rejoice!

", textilize("*This is Textile!* Rejoice!")) - end - - def test_textilize_with_blank - assert_equal("", textilize("")) - end - - def test_textilize_with_options - assert_equal("

This is worded <strong>strongly</strong>

", textilize("This is worded strongly", :filter_html)) - end - - def test_textilize_should_sanitize_unsafe_input - assert_equal("

This is worded strongly

", textilize("This is worded strongly")) - end - - def test_textilize_should_not_sanitize_input_if_safe_option - assert_equal("

This is worded strongly

", textilize("This is worded strongly", :safe)) - end - - def test_textilize_should_not_sanitize_safe_input - assert_equal("

This is worded strongly

", textilize("This is worded strongly".html_safe)) - end - - def test_textilize_with_hard_breaks - assert_equal("

This is one scary world.
\n True.

", 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("This is Textile! 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 strongly", :filter_html)) - end - - def test_textilize_without_paragraph_should_sanitize_unsafe_input - assert_equal("This is worded strongly", textilize_without_paragraph("This is worded strongly")) - end - - def test_textilize_without_paragraph_should_not_sanitize_input_if_safe_option - assert_equal("This is worded strongly", textilize_without_paragraph("This is worded strongly", :safe)) - end - - def test_textilize_without_paragraph_should_not_sanitize_safe_input - assert_equal("This is worded strongly", textilize_without_paragraph("This is worded strongly".html_safe)) - end - - def test_textilize_without_paragraph_with_hard_breaks - assert_equal("This is one scary world.
\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("

We are using Markdown now!

", 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("

This is worded strongly

", markdown("This is worded strongly")) - end - - def test_markdown_should_not_sanitize_input_if_safe_option - assert_equal("

This is worded strongly

", markdown("This is worded strongly", :safe)) - end - - def test_markdown_should_not_sanitize_safe_input - assert_equal("

This is worded strongly

", markdown("This is worded strongly".html_safe)) - end - - def test_markdown_with_hard_breaks - assert_equal("

This is one scary world.

\n\n

True.

", markdown("This is one scary world.\n\nTrue.")) - end - end end -- cgit v1.2.3