Sha256: 05a1ffa4fbc6cc52088c9371980beee7a0ec1f0b513e9ad52c0b5b1d68117c8d

Contents?: true

Size: 407 Bytes

Versions: 12

Compression:

Stored size: 407 Bytes

Contents

require File.dirname(__FILE__) + '/../unit_test_helper'

class HtmlEscapeTest < Test::Unit::TestCase

  def test_trasform
    result = auto_html("<script>alert(0)</script>") { html_escape }
    assert_equal "&lt;script&gt;alert(0)&lt;/script&gt;", result
  end

  def test_trasform2
    result = auto_html("<div>test</div>") { html_escape }
    assert_equal "&lt;div&gt;test&lt;/div&gt;", result
  end

end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
dejan-auto_html-1.1.0 test/unit/filters/html_escape_test.rb
dejan-auto_html-1.1.1 test/unit/filters/html_escape_test.rb
dejan-auto_html-1.1.2 test/unit/filters/html_escape_test.rb
dejan-auto_html-1.2.0 test/unit/filters/html_escape_test.rb
galetahub-auto_html-1.0.1 test/unit/filters/html_escape_test.rb
auto_html-1.3.4 test/unit/filters/html_escape_test.rb
auto_html-1.3.3 test/unit/filters/html_escape_test.rb
auto_html-1.3.2 test/unit/filters/html_escape_test.rb
auto_html-1.3.1 test/unit/filters/html_escape_test.rb
auto_html-1.3.0 test/unit/filters/html_escape_test.rb
auto_html-1.2.1 test/unit/filters/html_escape_test.rb
auto_html-1.2.0 test/unit/filters/html_escape_test.rb