The exhaustive tests are in test/controller/html/sanitizer_test.rb. This tests that the helpers hook up correctly to the sanitizer classes.
Methods
- T
Instance Public methods
test_sanitize_form()
Link
test_sanitize_is_marked_safe()
Link
test_should_sanitize_illegal_style_properties()
Link
# File actionview/test/template/sanitize_helper_test.rb, line 19 def test_should_sanitize_illegal_style_properties raw = %Q(display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;) expected = %Q(display: block; width: 100%; height: 100%; background-color: black; background-x: center; background-y: center;) assert_equal expected, sanitize_css(raw) end
test_strip_links()
Link
# File actionview/test/template/sanitize_helper_test.rb, line 8 def test_strip_links assert_equal "Dont touch me", strip_links("Dont touch me") assert_equal "on my mind\nall day long", strip_links("<a href='almost'>on my mind</a>\n<A href='almost'>all day long</A>") assert_equal "Magic", strip_links("<a href='http://www.rubyonrails.com/'>Mag<a href='http://www.ruby-lang.org/'>ic") assert_equal "My mind\nall <b>day</b> long", strip_links("<a href='almost'>My mind</a>\n<A href='almost'>all <b>day</b> long</A>") end