This project is archived and is in readonly mode.
Deprecation warning for assert_redirected_to doesn't tell you where the offending code is
-
Michael Koziarski
- Tag changed from 2.3.3, assert_redirected_to to 2.3.3, assert_redirected_to, bugmash
-
Josh Nichols
I have found this deprecation notice not to be reproducible. I found where it should be displayed, but have no idea what arguments to pass to make it happen.
Additionally, there does not seem to be a test for this deprecation in test/controllers/action_pack_assertions_test.rb
-
Josh Nichols
I take that back... verified:
Controller:
class MonkeysController < ApplicationController def index
redirect_to :controller => 'monkeys', :action => :show
end
def show
end endTest:
@@@ruby class MonkeysControllerTest < ActionController::TestCase
test "assert_redirected_to" doget :index assert_redirected_to :action => :showend end
DEPRECATION WARNING: Using assert_redirected_to with partial hash arguments is deprecated. Specify the full set arguments instead. (called from clean_backtrace at /Users/nichoj/code/experimental/2340-verification/vendor/rails/actionpack/lib/action_controller/test_case.rb:114)And the output...
-
Dan Croak
Josh is working on changing the output to include file and line number.
-
Josh Nichols
So, I've attached a patch that tries to use backtrace_cleaner for Deprecation. It works for the example case, but there's a few tests it seems to break, when it enters the cleaning process.
-
Josh Nichols
I opened #3015 use backtrace_cleaners when using Deprecation#warn as a more general case of this issue, and included a better patch.
-
Jeremy Kemper
- State changed from new to resolved
- Milestone changed from 2.x to 2.3.4
2-3-stable: ab6d295ce41ba2aad400474dcf45052e7b631b53
-
Jeremy Kemper
- State changed from resolved to new
- Tag changed from 2.3.3, assert_redirected_to, bugmash to 2.3.3, assert_redirected_to
- Milestone changed from 2.3.4 to 2.x
-
Jeremy Kemper
- State changed from new to resolved
- Milestone changed from 2.x to 2.3.4
GRR lighthouse.
-
Repository
- State changed from resolved to committed
(from [ab6d295ce41ba2aad400474dcf45052e7b631b53]) Fix caller in assert_redirected_to deprecation warning.
[#2932 Deprecation warning for assert_redirected_to doesn't tell you where the offen... state:committed] http://github.com/rails/rails/commit/ab6d295ce41ba2aad400474dcf4505...
-
Josh Nichols
I'm a little confused why you'd go and apply super-specific fix for this, ie assert_redirected_to, when there's a fix for a more general problem of Deprecation.warn reporting the wrong line.
I mean, I guess it's technically fixed for this particular reporting, but why make it brittle to what's calling it, and also having it remain for everything else using Deprecation.warn?
-
Jeremy Kemper
Because it's quick and easy and your better, more general fix was not
available yet!
