Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tests method_missing to raise NameError. [#2522 state:resolved]

Signed-off-by: wycats <wycats@gmail.com>
  • Loading branch information...
commit 167017f65558a4461aaf8dc26a6f329a283366c2 1 parent 3d746fc
@rizwanreza rizwanreza authored wycats committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 actionpack/test/controller/base_test.rb
View
16 actionpack/test/controller/base_test.rb
@@ -56,6 +56,16 @@ def method_missing(selector)
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]} %>"
@@ -173,6 +183,12 @@ def test_method_missing_is_not_an_action_name
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(ActionController::UnknownAction) { get :hidden_action }
Please sign in to comment.
Something went wrong with that request. Please try again.