diff --git a/test/apps/rails3/app/controllers/home_controller.rb b/test/apps/rails3/app/controllers/home_controller.rb index 3f8e8618b639281c98cd63930ebf164c64f6517a..76cf033c18dc48451b2ae08e05439c48e778315b 100644 --- a/test/apps/rails3/app/controllers/home_controller.rb +++ b/test/apps/rails3/app/controllers/home_controller.rb @@ -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 diff --git a/test/tests/test_rails3.rb b/test/tests/test_rails3.rb index 4007242b0893c8c70f7342af2216741dcbcf6db2..6e6eec4f31b783bf8e33732ca6e7f5abed51c450 100644 --- a/test/tests/test_rails3.rb +++ b/test/tests/test_rails3.rb @@ -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",