A Couple of Unit Tests
This commit is contained in:
parent
e8769c0b83
commit
1259e16a4a
|
@ -19,4 +19,11 @@ class CategoryTest < Test::Unit::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
def test_multiple_categories_sanitized
|
||||
match(Category, 'category: test, multiple,<span>a & b</span> <script>alert("XSS!");</script>', :list => ['test', 'multiple', '<span>a & b</span> <script>alert("XSS!");</script>'], :hidden => nil)
|
||||
match(Category, 'category : chunk test , multi category,<span>a & b</span> <script>alert("XSS!");</script>',
|
||||
:list => ['chunk test','multi category','<span>a & b</span> <script>alert("XSS!");</script>'], :hidden => nil
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -12,4 +12,10 @@ class NoWikiTest < Test::Unit::TestCase
|
|||
)
|
||||
end
|
||||
|
||||
def test_sanitized_nowiki
|
||||
match(NoWiki, 'This sentence contains <nowiki><span>a & b</span> <script>alert("XSS!");</script></nowiki>. Do not touch!',
|
||||
:plain_text => '<span>a & b</span> <script>alert("XSS!");</script>'
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue