提交 63876137 编写于 作者: J Justin Collins

Add test for `request.parameters`

上级 e80fbbe1
......@@ -15,4 +15,6 @@ Dangerous href: <%= link_to "more text", params[:dangerous] %>
Still dangerous hrefs: <%= link_to "donkey", not_safe(params[:bad_robot]) %>
Not completely safe: <%= link_to "Helvetica hoodie bushwick", h(params[:js_xss]) %>
\ No newline at end of file
Not completely safe: <%= link_to "Helvetica hoodie bushwick", h(params[:js_xss]) %>
Request parameters: <%= raw request.parameters %>
......@@ -14,7 +14,7 @@ class Rails3Tests < Test::Unit::TestCase
@expected ||= {
:controller => 1,
:model => 5,
:template => 21,
:template => 22,
:warning => 24
}
end
......@@ -548,4 +548,13 @@ class Rails3Tests < Test::Unit::TestCase
:confidence => 0,
:file => /_form\.html\.erb/
end
def test_cross_site_scripting_request_parameters
assert_warning :type => :template,
:warning_type => "Cross Site Scripting",
:line => 20,
:message => /^Unescaped\ parameter\ value/,
:confidence => 0,
:file => /test_params\.html\.erb/
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册