Upgrade to Rails 2.2.0
As a side benefit, fix an (non-user-visible) bug in display_s5(). Also fixed a bug where removing orphaned pages did not expire cached summary pages.
This commit is contained in:
parent
39348c65c2
commit
7600aef48b
827 changed files with 123652 additions and 11027 deletions
|
@ -62,6 +62,11 @@ class RescueController < ActionController::Base
|
|||
render :text => exception.message
|
||||
end
|
||||
|
||||
# This is a Dispatcher exception and should be in ApplicationController.
|
||||
rescue_from ActionController::RoutingError do
|
||||
render :text => 'no way'
|
||||
end
|
||||
|
||||
def raises
|
||||
render :text => 'already rendered'
|
||||
raise "don't panic!"
|
||||
|
@ -70,7 +75,7 @@ class RescueController < ActionController::Base
|
|||
def method_not_allowed
|
||||
raise ActionController::MethodNotAllowed.new(:get, :head, :put)
|
||||
end
|
||||
|
||||
|
||||
def not_implemented
|
||||
raise ActionController::NotImplemented.new(:get, :put)
|
||||
end
|
||||
|
@ -102,7 +107,7 @@ class RescueController < ActionController::Base
|
|||
def record_invalid_raise_as_string
|
||||
raise RecordInvalidToRescueAsString
|
||||
end
|
||||
|
||||
|
||||
def bad_gateway
|
||||
raise BadGateway
|
||||
end
|
||||
|
@ -130,18 +135,19 @@ class RescueController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
class RescueTest < Test::Unit::TestCase
|
||||
class RescueControllerTest < ActionController::TestCase
|
||||
FIXTURE_PUBLIC = "#{File.dirname(__FILE__)}/../fixtures".freeze
|
||||
|
||||
def setup
|
||||
@controller = RescueController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
setup :set_all_requests_local
|
||||
setup :populate_exception_object
|
||||
|
||||
def set_all_requests_local
|
||||
RescueController.consider_all_requests_local = true
|
||||
@request.remote_addr = '1.2.3.4'
|
||||
@request.host = 'example.com'
|
||||
end
|
||||
|
||||
def populate_exception_object
|
||||
begin
|
||||
raise 'foo'
|
||||
rescue => @exception
|
||||
|
@ -302,7 +308,7 @@ class RescueTest < Test::Unit::TestCase
|
|||
assert_nil @controller.send(:clean_backtrace, Exception.new)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def test_not_implemented
|
||||
with_all_requests_local false do
|
||||
with_rails_public_path(".") do
|
||||
|
@ -378,6 +384,10 @@ class RescueTest < Test::Unit::TestCase
|
|||
assert_equal "RescueController::ResourceUnavailableToRescueAsString", @response.body
|
||||
end
|
||||
|
||||
def test_rescue_dispatcher_exceptions
|
||||
RescueController.process_with_exception(@request, @response, ActionController::RoutingError.new("Route not found"))
|
||||
assert_equal "no way", @response.body
|
||||
end
|
||||
|
||||
protected
|
||||
def with_all_requests_local(local = true)
|
||||
|
@ -454,14 +464,7 @@ class ExceptionInheritanceRescueController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
class ExceptionInheritanceRescueTest < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@controller = ExceptionInheritanceRescueController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
class ExceptionInheritanceRescueControllerTest < ActionController::TestCase
|
||||
def test_bottom_first
|
||||
get :raise_grandchild_exception
|
||||
assert_response :no_content
|
||||
|
@ -491,14 +494,7 @@ class ControllerInheritanceRescueController < ExceptionInheritanceRescueControll
|
|||
end
|
||||
end
|
||||
|
||||
class ControllerInheritanceRescueControllerTest < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@controller = ControllerInheritanceRescueController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
class ControllerInheritanceRescueControllerTest < ActionController::TestCase
|
||||
def test_first_exception_in_child_controller
|
||||
get :raise_first_exception_in_child_controller
|
||||
assert_response :gone
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue