Merge pull request #9802 from newsline/fix-broken-action-missing
Fix missing action_missing Conflicts: actionpack/CHANGELOG.md
This commit is contained in:
commit
066907d1cb
@ -27,7 +27,7 @@ def hide_action(*args)
|
||||
end
|
||||
|
||||
def visible_action?(action_name)
|
||||
action_methods.include?(action_name)
|
||||
not hidden_actions.include?(action_name)
|
||||
end
|
||||
|
||||
# Overrides AbstractController::Base#action_methods to remove any methods
|
||||
|
@ -68,6 +68,12 @@ class RecordIdentifierWithoutDeprecationController < ActionController::Base
|
||||
include ActionView::RecordIdentifier
|
||||
end
|
||||
|
||||
class ActionMissingController < ActionController::Base
|
||||
def action_missing(action)
|
||||
render :text => "Response for #{action}"
|
||||
end
|
||||
end
|
||||
|
||||
class ControllerClassTests < ActiveSupport::TestCase
|
||||
|
||||
def test_controller_path
|
||||
@ -186,6 +192,12 @@ def test_get_on_hidden_should_fail
|
||||
assert_raise(AbstractController::ActionNotFound) { get :hidden_action }
|
||||
assert_raise(AbstractController::ActionNotFound) { get :another_hidden_action }
|
||||
end
|
||||
|
||||
def test_action_missing_should_work
|
||||
use_controller ActionMissingController
|
||||
get :arbitrary_action
|
||||
assert_equal "Response for arbitrary_action", @response.body
|
||||
end
|
||||
end
|
||||
|
||||
class UrlOptionsTest < ActionController::TestCase
|
||||
|
Loading…
Reference in New Issue
Block a user