Aliased AbstractController::ActionNotFound to ActionController::UnknownAction

上级 94ee9d24
...@@ -3,6 +3,9 @@ module Rails2Compatibility ...@@ -3,6 +3,9 @@ module Rails2Compatibility
# Temporary hax # Temporary hax
setup do setup do
::ActionController::UnknownAction = ::AbstractController::ActionNotFound
::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError
cattr_accessor :session_options cattr_accessor :session_options
self.send(:class_variable_set, "@@session_options", {}) self.send(:class_variable_set, "@@session_options", {})
...@@ -31,11 +34,11 @@ def render_to_body(options) ...@@ -31,11 +34,11 @@ def render_to_body(options)
super super
end end
def _layout_for_name(name) def _layout_for_name(name)
name &&= name.sub(%r{^/?layouts/}, '') name &&= name.sub(%r{^/?layouts/}, '')
super super
end end
end end
end end
\ No newline at end of file
...@@ -39,6 +39,7 @@ def process(action, parameters = nil, session = nil, flash = nil, http_method = ...@@ -39,6 +39,7 @@ def process(action, parameters = nil, session = nil, flash = nil, http_method =
@request.recycle! @request.recycle!
@response.recycle! @response.recycle!
@controller.response_body = nil
@html_document = nil @html_document = nil
@request.env['REQUEST_METHOD'] = http_method @request.env['REQUEST_METHOD'] = http_method
......
...@@ -57,9 +57,6 @@ class NotImplemented < MethodNotAllowed #:nodoc: ...@@ -57,9 +57,6 @@ class NotImplemented < MethodNotAllowed #:nodoc:
class UnknownController < ActionControllerError #:nodoc: class UnknownController < ActionControllerError #:nodoc:
end end
class UnknownAction < ActionControllerError #:nodoc:
end
class MissingFile < ActionControllerError #:nodoc: class MissingFile < ActionControllerError #:nodoc:
end end
......
...@@ -1680,11 +1680,12 @@ def test_render_with_etag ...@@ -1680,11 +1680,12 @@ def test_render_with_etag
@request.if_none_match = expected_etag @request.if_none_match = expected_etag
get :render_hello_world_from_variable get :render_hello_world_from_variable
assert_equal "304 Not Modified", @response.status assert_equal 304, @response.status.to_i
@response = ActionController::TestResponse.new
@request.if_none_match = "\"diftag\"" @request.if_none_match = "\"diftag\""
get :render_hello_world_from_variable get :render_hello_world_from_variable
assert_equal "200 OK", @response.status assert_equal 200, @response.status.to_i
end end
def render_with_404_shouldnt_have_etag def render_with_404_shouldnt_have_etag
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册