diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-16 03:41:11 +0200 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-16 03:41:11 +0200 |
commit | 931f366ffcacc0444fcca2fb2e2b44644db9642f (patch) | |
tree | 4c056de1273d23e2b8494cfe452caaeb98ade820 /actionpack/test/controller/html-scanner/document_test.rb | |
parent | 8691e255402b27eae594530001227fc05416a00c (diff) | |
parent | fbef982e4b906b879240a35a1ecff447007da6b2 (diff) | |
download | rails-931f366ffcacc0444fcca2fb2e2b44644db9642f.tar.gz rails-931f366ffcacc0444fcca2fb2e2b44644db9642f.tar.bz2 rails-931f366ffcacc0444fcca2fb2e2b44644db9642f.zip |
merge forward to current rails/master
Diffstat (limited to 'actionpack/test/controller/html-scanner/document_test.rb')
-rw-r--r-- | actionpack/test/controller/html-scanner/document_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/actionpack/test/controller/html-scanner/document_test.rb b/actionpack/test/controller/html-scanner/document_test.rb index 0519533dbd..1c3facb9e3 100644 --- a/actionpack/test/controller/html-scanner/document_test.rb +++ b/actionpack/test/controller/html-scanner/document_test.rb @@ -120,4 +120,29 @@ HTML assert doc.find(:tag => "div", :attributes => { :id => "map" }, :content => "") assert doc.find(:tag => "div", :attributes => { :id => "map" }, :content => nil) end + + def test_parse_invalid_document + assert_nothing_raised do + doc = HTML::Document.new("<html> + <table> + <tr> + <td style=\"color: #FFFFFF; height: 17px; onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" style=\"cursor:pointer; height: 17px;\"; nowrap onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" onmouseout=\"this.bgColor='#0066cc'; this.style.color='#FFFFFF'\" onmouseover=\"this.bgColor='#ffffff'; this.style.color='#0033cc'\">About Us</td> + </tr> + </table> + </html>") + end + end + + def test_invalid_document_raises_exception_when_strict + assert_raises RuntimeError do + doc = HTML::Document.new("<html> + <table> + <tr> + <td style=\"color: #FFFFFF; height: 17px; onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" style=\"cursor:pointer; height: 17px;\"; nowrap onclick=\"window.location.href='http://www.rmeinc.com/about_rme.aspx'\" onmouseout=\"this.bgColor='#0066cc'; this.style.color='#FFFFFF'\" onmouseover=\"this.bgColor='#ffffff'; this.style.color='#0033cc'\">About Us</td> + </tr> + </table> + </html>", true) + end + end + end |