aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/text_helper_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-06-10 22:00:55 +0200
committerXavier Noria <fxn@hashref.com>2010-06-10 22:00:55 +0200
commit63560660062d552d6bbebec007154f0c639bf865 (patch)
tree0ff7ee5c1a63815685e9640ca4a9ceafb7732178 /actionpack/test/template/text_helper_test.rb
parent59e89facc2264322bcab59c9a8622380b62d4d40 (diff)
parent61fc7a455099f179de88967f403f2038b9d3c821 (diff)
downloadrails-63560660062d552d6bbebec007154f0c639bf865.tar.gz
rails-63560660062d552d6bbebec007154f0c639bf865.tar.bz2
rails-63560660062d552d6bbebec007154f0c639bf865.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/test/template/text_helper_test.rb')
-rw-r--r--actionpack/test/template/text_helper_test.rb108
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 &lt;strong&gt;strongly&lt;/strong&gt;</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 &lt;strong&gt;strongly&lt;/strong&gt;", 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