aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2014-08-07 17:20:17 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2014-08-07 17:43:36 +0800
commit14508aec701a366713572908de76fec134f6a2c3 (patch)
treeff3c66c124e873556a9d7d423a1f4e3bf731bad0 /actionpack/lib
parente6e81f856e969efda49166af82c27594f30ea592 (diff)
downloadrails-14508aec701a366713572908de76fec134f6a2c3.tar.gz
rails-14508aec701a366713572908de76fec134f6a2c3.tar.bz2
rails-14508aec701a366713572908de76fec134f6a2c3.zip
Remove ActionController::RaiseActionExceptions.
The latest modification to the code was done in https://github.com/rails/rails/commit/5e3517ea. In Rails 3.2, `ActionController#rescue_action` was deprecated and `rescue_action_without_handler` is no longer being used.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/test_case.rb34
1 files changed, 0 insertions, 34 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 9d0ec6f4de..eb5d824cbc 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -456,7 +456,6 @@ module ActionController
end
def controller_class=(new_class)
- prepare_controller_class(new_class) if new_class
self._controller_class = new_class
end
@@ -473,11 +472,6 @@ module ActionController
Class === constant && constant < ActionController::Metal
end
end
-
- def prepare_controller_class(new_class)
- new_class.send :include, ActionController::TestCase::RaiseActionExceptions
- end
-
end
# Simulate a GET request with the given parameters.
@@ -713,34 +707,6 @@ module ActionController
end
end
- # When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline
- # (skipping the regular exception handling from rescue_action). If the request.remote_addr is anything else, the regular
- # rescue_action process takes place. This means you can test your rescue_action code by setting remote_addr to something else
- # than 0.0.0.0.
- #
- # The exception is stored in the exception accessor for further inspection.
- module RaiseActionExceptions
- def self.included(base) #:nodoc:
- unless base.method_defined?(:exception) && base.method_defined?(:exception=)
- base.class_eval do
- attr_accessor :exception
- protected :exception, :exception=
- end
- end
- end
-
- protected
- def rescue_action_without_handler(e)
- self.exception = e
-
- if request.remote_addr == "0.0.0.0"
- raise(e)
- else
- super(e)
- end
- end
- end
-
include Behavior
end
end