mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Missing method error doesn't specify which controller it is missing from [#4436 state:resolved]
The error page shown when the method you are requesting on a controller doesn't specify which controller the method is missing from Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
51590ad175
commit
566967eaf3
2 changed files with 11 additions and 2 deletions
|
@ -106,7 +106,7 @@ module AbstractController
|
|||
@_action_name = action_name = action.to_s
|
||||
|
||||
unless action_name = method_for_action(action_name)
|
||||
raise ActionNotFound, "The action '#{action}' could not be found"
|
||||
raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
|
||||
end
|
||||
|
||||
@_response_body = nil
|
||||
|
|
|
@ -90,6 +90,7 @@ class RecordIdentifierController < ActionController::Base
|
|||
end
|
||||
|
||||
class ControllerClassTests < ActiveSupport::TestCase
|
||||
|
||||
def test_controller_path
|
||||
assert_equal 'empty', EmptyController.controller_path
|
||||
assert_equal EmptyController.controller_path, EmptyController.new.controller_path
|
||||
|
@ -166,7 +167,15 @@ class PerformActionTest < ActionController::TestCase
|
|||
|
||||
rescue_action_in_public!
|
||||
end
|
||||
|
||||
|
||||
def test_process_should_be_precise
|
||||
use_controller EmptyController
|
||||
exception = assert_raise AbstractController::ActionNotFound do
|
||||
get :non_existent
|
||||
end
|
||||
assert_equal exception.message, "The action 'non_existent' could not be found for EmptyController"
|
||||
end
|
||||
|
||||
def test_get_on_priv_should_show_selector
|
||||
use_controller MethodMissingController
|
||||
get :shouldnt_be_called
|
||||
|
|
Loading…
Reference in a new issue