diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-15 15:47:45 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-01-17 10:04:38 -0200 |
commit | a977b2588e46ab5b9b8a1cb2a8f7482988c64486 (patch) | |
tree | 8933bfc09028605c45bbc34bff91acdbb2c2ad8d /actionpack/test/controller | |
parent | 53596d091390bda7fb9b78ad838273a9e63fbde1 (diff) | |
download | rails-a977b2588e46ab5b9b8a1cb2a8f7482988c64486.tar.gz rails-a977b2588e46ab5b9b8a1cb2a8f7482988c64486.tar.bz2 rails-a977b2588e46ab5b9b8a1cb2a8f7482988c64486.zip |
Remove method missing handling when action is not found, use action missing instead
Do not create a method_missing method to handle not found actions, use
the action_missing method provided by Rails instead.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/base_test.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index bda80d1c20..b95a524612 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -40,29 +40,6 @@ class NonEmptyController < ActionController::Base end end -class MethodMissingController < ActionController::Base - hide_action :shouldnt_be_called - def shouldnt_be_called - raise "NO WAY!" - end - -protected - - def method_missing(selector) - render :text => selector.to_s - end -end - -class AnotherMethodMissingController < ActionController::Base - cattr_accessor :_exception - rescue_from Exception, :with => :_exception= - - protected - def method_missing(*attrs, &block) - super - end -end - class DefaultUrlOptionsController < ActionController::Base def from_view render :inline => "<%= #{params[:route]} %>" @@ -159,28 +136,6 @@ class PerformActionTest < ActionController::TestCase 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 - assert_response :success - assert_equal 'shouldnt_be_called', @response.body - end - - def test_method_missing_is_not_an_action_name - use_controller MethodMissingController - assert !@controller.__send__(:action_method?, 'method_missing') - - get :method_missing - assert_response :success - assert_equal 'method_missing', @response.body - end - - def test_method_missing_should_recieve_symbol - use_controller AnotherMethodMissingController - get :some_action - assert_kind_of NameError, @controller._exception - end - def test_get_on_hidden_should_fail use_controller NonEmptyController assert_raise(AbstractController::ActionNotFound) { get :hidden_action } |