mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Deprecate assert_redirect_to's partial hash matching. This will be fully removed in 3.0.
This commit is contained in:
@@ -63,7 +63,10 @@ module ActionController
|
|||||||
|
|
||||||
# Support partial arguments for hash redirections
|
# Support partial arguments for hash redirections
|
||||||
if options.is_a?(Hash) && @response.redirected_to.is_a?(Hash)
|
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
|
end
|
||||||
|
|
||||||
redirected_to_after_normalisation = normalize_argument_to_redirection(@response.redirected_to)
|
redirected_to_after_normalisation = normalize_argument_to_redirection(@response.redirected_to)
|
||||||
|
|||||||
@@ -235,7 +235,10 @@ class RedirectTest < ActionController::TestCase
|
|||||||
|
|
||||||
def test_redirect_with_partial_params
|
def test_redirect_with_partial_params
|
||||||
get :module_redirect
|
get :module_redirect
|
||||||
assert_redirected_to :action => 'hello_world'
|
|
||||||
|
assert_deprecated do
|
||||||
|
assert_redirected_to :action => 'hello_world'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_redirect_to_nil
|
def test_redirect_to_nil
|
||||||
|
|||||||
Reference in New Issue
Block a user