mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove other old compatibility constants
This commit is contained in:
parent
6f8b1e3a85
commit
1ae9e60b8a
6 changed files with 12 additions and 15 deletions
|
@ -4,9 +4,6 @@ module ActionController
|
|||
|
||||
# Temporary hax
|
||||
included do
|
||||
::ActionController::UnknownAction = ::AbstractController::ActionNotFound
|
||||
::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError
|
||||
|
||||
# ROUTES TODO: This should be handled by a middleware and route generation
|
||||
# should be able to handle SCRIPT_NAME
|
||||
self.config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
|
||||
|
|
|
@ -43,4 +43,4 @@ module ActionController
|
|||
|
||||
class UnknownHttpMethod < ActionControllerError #:nodoc:
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -183,8 +183,8 @@ class PerformActionTest < ActionController::TestCase
|
|||
|
||||
def test_get_on_hidden_should_fail
|
||||
use_controller NonEmptyController
|
||||
assert_raise(ActionController::UnknownAction) { get :hidden_action }
|
||||
assert_raise(ActionController::UnknownAction) { get :another_hidden_action }
|
||||
assert_raise(AbstractController::ActionNotFound) { get :hidden_action }
|
||||
assert_raise(AbstractController::ActionNotFound) { get :another_hidden_action }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class TestController < ActionController::Base
|
|||
|
||||
def conditional_hello_with_record
|
||||
record = Struct.new(:updated_at, :cache_key).new(Time.now.utc.beginning_of_day, "foo/123")
|
||||
|
||||
|
||||
if stale?(record)
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
|
@ -891,12 +891,12 @@ class RenderTest < ActionController::TestCase
|
|||
|
||||
# :ported:
|
||||
def test_attempt_to_access_object_method
|
||||
assert_raise(ActionController::UnknownAction, "No action responded to [clone]") { get :clone }
|
||||
assert_raise(AbstractController::ActionNotFound, "No action responded to [clone]") { get :clone }
|
||||
end
|
||||
|
||||
# :ported:
|
||||
def test_private_methods
|
||||
assert_raise(ActionController::UnknownAction, "No action responded to [determine_layout]") { get :determine_layout }
|
||||
assert_raise(AbstractController::ActionNotFound, "No action responded to [determine_layout]") { get :determine_layout }
|
||||
end
|
||||
|
||||
# :ported:
|
||||
|
@ -1096,15 +1096,15 @@ class RenderTest < ActionController::TestCase
|
|||
|
||||
# :ported:
|
||||
def test_double_render
|
||||
assert_raise(ActionController::DoubleRenderError) { get :double_render }
|
||||
assert_raise(AbstractController::DoubleRenderError) { get :double_render }
|
||||
end
|
||||
|
||||
def test_double_redirect
|
||||
assert_raise(ActionController::DoubleRenderError) { get :double_redirect }
|
||||
assert_raise(AbstractController::DoubleRenderError) { get :double_redirect }
|
||||
end
|
||||
|
||||
def test_render_and_redirect
|
||||
assert_raise(ActionController::DoubleRenderError) { get :render_and_redirect }
|
||||
assert_raise(AbstractController::DoubleRenderError) { get :render_and_redirect }
|
||||
end
|
||||
|
||||
# specify the one exception to double render rule - render_to_string followed by render
|
||||
|
|
|
@ -24,7 +24,7 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
|||
when "/pass"
|
||||
[404, { "X-Cascade" => "pass" }, self]
|
||||
when "/not_found"
|
||||
raise ActionController::UnknownAction
|
||||
raise AbstractController::ActionNotFound
|
||||
when "/runtime_error"
|
||||
raise RuntimeError
|
||||
when "/method_not_allowed"
|
||||
|
@ -83,7 +83,7 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
|||
|
||||
get "/not_found", {}, {'action_dispatch.show_exceptions' => true}
|
||||
assert_response 404
|
||||
assert_match(/#{ActionController::UnknownAction.name}/, body)
|
||||
assert_match(/#{AbstractController::ActionNotFound.name}/, body)
|
||||
|
||||
get "/method_not_allowed", {}, {'action_dispatch.show_exceptions' => true}
|
||||
assert_response 405
|
||||
|
|
|
@ -7,7 +7,7 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest
|
|||
req = ActionDispatch::Request.new(env)
|
||||
case req.path
|
||||
when "/not_found"
|
||||
raise ActionController::UnknownAction
|
||||
raise AbstractController::ActionNotFound
|
||||
when "/method_not_allowed"
|
||||
raise ActionController::MethodNotAllowed
|
||||
when "/not_found_original_exception"
|
||||
|
|
Loading…
Reference in a new issue