X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factionpack%2Ftest%2Fcontroller%2Fdispatcher_test.rb;fp=vendor%2Frails%2Factionpack%2Ftest%2Fcontroller%2Fdispatcher_test.rb;h=0000000000000000000000000000000000000000;hb=36d9f3351a3b4e8159279445190e2287ffdea86c;hp=7887b7110c5340c65d2c915b4550484598ff4a15;hpb=913cf6054b1d29b5d2f5e620304af7ee77cc1f1f;p=feedcatcher.git diff --git a/vendor/rails/actionpack/test/controller/dispatcher_test.rb b/vendor/rails/actionpack/test/controller/dispatcher_test.rb deleted file mode 100644 index 7887b71..0000000 --- a/vendor/rails/actionpack/test/controller/dispatcher_test.rb +++ /dev/null @@ -1,103 +0,0 @@ -require 'abstract_unit' - -class DispatcherTest < Test::Unit::TestCase - Dispatcher = ActionController::Dispatcher - - def setup - ENV['REQUEST_METHOD'] = 'GET' - - Dispatcher.middleware = ActionController::MiddlewareStack.new do |middleware| - middlewares = File.expand_path(File.join(File.dirname(__FILE__), "../../lib/action_controller/middlewares.rb")) - middleware.instance_eval(File.read(middlewares)) - end - - # Clear callbacks as they are redefined by Dispatcher#define_dispatcher_callbacks - Dispatcher.instance_variable_set("@prepare_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new) - Dispatcher.instance_variable_set("@before_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new) - Dispatcher.instance_variable_set("@after_dispatch_callbacks", ActiveSupport::Callbacks::CallbackChain.new) - - Dispatcher.stubs(:require_dependency) - end - - def teardown - ENV.delete 'REQUEST_METHOD' - end - - def test_clears_dependencies_after_dispatch_if_in_loading_mode - ActiveSupport::Dependencies.expects(:clear).once - dispatch(false) - end - - def test_reloads_routes_before_dispatch_if_in_loading_mode - ActionController::Routing::Routes.expects(:reload).once - dispatch(false) - end - - def test_leaves_dependencies_after_dispatch_if_not_in_loading_mode - ActionController::Routing::Routes.expects(:reload).never - ActiveSupport::Dependencies.expects(:clear).never - - dispatch - end - - # Stub out dispatch error logger - class << Dispatcher - def log_failsafe_exception(status, exception); end - end - - def test_failsafe_response - Dispatcher.any_instance.expects(:dispatch).raises('b00m') - ActionController::Failsafe.any_instance.expects(:log_failsafe_exception) - - assert_nothing_raised do - assert_equal [ - 500, - {"Content-Type" => "text/html"}, - "