Aliased AbstractController::ActionNotFound to ActionController::UnknownAction

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