1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Deprecate assert_redirect_to's partial hash matching. This will be fully removed in 3.0.

This commit is contained in:
Joshua Peek 2009-05-04 20:24:49 -05:00
parent 5ac05f15c6
commit 7f1f16c01f
2 changed files with 8 additions and 2 deletions

View file

@ -63,7 +63,10 @@ module ActionController
# Support partial arguments for hash redirections
if options.is_a?(Hash) && @response.redirected_to.is_a?(Hash)
return true if options.all? {|(key, value)| @response.redirected_to[key] == value}
if options.all? {|(key, value)| @response.redirected_to[key] == value}
::ActiveSupport::Deprecation.warn("Using assert_redirected_to with partial hash arguments is deprecated. Specify the full set arguments instead", caller)
return true
end
end
redirected_to_after_normalisation = normalize_argument_to_redirection(@response.redirected_to)

View file

@ -235,8 +235,11 @@ class RedirectTest < ActionController::TestCase
def test_redirect_with_partial_params
get :module_redirect
assert_deprecated do
assert_redirected_to :action => 'hello_world'
end
end
def test_redirect_to_nil
assert_raise(ActionController::ActionControllerError) do