Permalink
Browse files

Merge pull request #9802 from newsline/fix-broken-action-missing

Fix missing action_missing

Conflicts:
	actionpack/CHANGELOG.md
  • Loading branch information...
2 parents f73c52c + 0dfa6cb commit 066907d1cb3e7e390287dff9c324a4091d76a97b @rafaelfranca rafaelfranca committed Mar 20, 2013
Showing with 13 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_controller/metal/hide_actions.rb
  2. +12 −0 actionpack/test/controller/base_test.rb
@@ -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}"
@mdespuits

mdespuits Mar 20, 2013

Contributor

Ruby 1.9 hash syntax?

+ 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

0 comments on commit 066907d

Please sign in to comment.