Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10364: sanitizer_tests_fix.diff

File sanitizer_tests_fix.diff, 0.8 kB (added by chuyeow, 7 months ago)
  • actionpack/test/controller/html-scanner/sanitizer_test.rb

    old new  
    106106  end 
    107107 
    108108  def test_should_allow_custom_tags_with_attributes 
    109     text = %(<fieldset foo="bar">foo</fieldset>) 
     109    text = %(<blockquote cite="http://example.com/">foo</blockquote>) 
    110110    sanitizer = HTML::WhiteListSanitizer.new 
     111    assert_equal(text, sanitizer.sanitize(text)) 
     112  end 
     113 
     114  def test_should_allow_custom_tags_with_custom_attributes 
     115    text = %(<blockquote foo="bar">Lorem ipsum</blockquote>) 
     116    sanitizer = HTML::WhiteListSanitizer.new 
    111117    assert_equal(text, sanitizer.sanitize(text, :attributes => ['foo'])) 
    112118  end 
    113119