Browse files

Fix caller in assert_redirected_to deprecation warning.

[#2932 state:committed]
  • Loading branch information...
1 parent 6843fb9 commit ab6d295ce41ba2aad400474dcf45052e7b631b53 @jeremy jeremy committed Aug 8, 2009
View
4 actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -64,7 +64,9 @@ def assert_redirected_to(options = {}, message=nil)
# Support partial arguments for hash redirections
if options.is_a?(Hash) && @response.redirected_to.is_a?(Hash)
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)
+ callstack = caller.dup
+ callstack.slice!(0, 2)
+ ::ActiveSupport::Deprecation.warn("Using assert_redirected_to with partial hash arguments is deprecated. Specify the full set arguments instead", callstack)
return true
end
end
View
2 actionpack/test/controller/redirect_test.rb
@@ -236,7 +236,7 @@ def test_redirect_to_record
def test_redirect_with_partial_params
get :module_redirect
- assert_deprecated do
+ assert_deprecated(/test_redirect_with_partial_params/) do
assert_redirected_to :action => 'hello_world'
end
end

2 comments on commit ab6d295

@nroose

Seems like this is warning about taking away a good feature. What is the rational?

@rdp

the rdoc says it is still ok.

Please sign in to comment.