提交 940cb65c 编写于 作者: J Justin Collins 提交者: Dave Worth

Add test for redirect_to :only_path => true

check already exists, but no tests for it
上级 ceab657b
......@@ -73,6 +73,10 @@ class HomeController < ApplicationController
current_user.something.something.build(params[:awesome_user])
end
def test_only_path
redirect_to params[:user], :only_path => true
end
private
def filter_it
......
......@@ -122,6 +122,15 @@ class Rails3Tests < Test::Unit::TestCase
:file => /products_controller\.rb/
end
def test_redirect_only_path
assert_no_warning :type => :warning,
:warning_type => "Redirect",
:line => 78,
:message => /^Possible unprotected redirect near line 78: redirect_to\(params\[/,
:confidence => 0,
:file => /home_controller\.rb/
end
def test_render_path
assert_warning :type => :warning,
:warning_type => "Dynamic Render Path",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册