From 8118fca9beec675fba19395e7d1027eaa4b5703a Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 17 May 2009 12:24:42 -0500 Subject: Merge Failsafe middleware into ShowExceptions --- actionpack/test/controller/rescue_test.rb | 14 ++++++++++++++ actionpack/test/dispatch/show_exceptions_test.rb | 5 +++++ actionpack/test/new_base/render_action_test.rb | 4 ++-- actionpack/test/new_base/render_test.rb | 6 +++--- 4 files changed, 24 insertions(+), 5 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index f745926b20..490a4ff3b3 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -1,5 +1,19 @@ require 'abstract_unit' +module ActionDispatch + class ShowExceptions + private + def public_path + "#{FIXTURE_LOAD_PATH}/public" + end + + # Silence logger + def logger + nil + end + end +end + class RescueController < ActionController::Base class NotAuthorized < StandardError end diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index f8f562e7c1..0c0c087340 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -6,6 +6,11 @@ module ActionDispatch def public_path "#{FIXTURE_LOAD_PATH}/public" end + + # Silence logger + def logger + nil + end end end diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb index 96666077d2..626c7b3540 100644 --- a/actionpack/test/new_base/render_action_test.rb +++ b/actionpack/test/new_base/render_action_test.rb @@ -92,7 +92,7 @@ module RenderAction test "raises an exception when requesting a layout and none exist" do assert_raise(ArgumentError, /no default layout for RenderAction::BasicController in/) do - get "/render_action/basic/hello_world_with_layout", {}, "rails.raise_exceptions" => true + get "/render_action/basic/hello_world_with_layout", {}, "action_dispatch.show_exceptions" => false end end end @@ -118,7 +118,7 @@ module RenderAction test "raises an exception when requesting a layout that does not exist" do assert_raise(ActionView::MissingTemplate) do - get "/render_action/basic/hello_world_with_custom_layout", {}, "rails.raise_exceptions" => true + get "/render_action/basic/hello_world_with_custom_layout", {}, "action_dispatch.show_exceptions" => false end end end diff --git a/actionpack/test/new_base/render_test.rb b/actionpack/test/new_base/render_test.rb index 16578fbc82..ef5e7d89c5 100644 --- a/actionpack/test/new_base/render_test.rb +++ b/actionpack/test/new_base/render_test.rb @@ -48,7 +48,7 @@ module Render test "raises an exception" do assert_raises(AbstractController::DoubleRenderError) do - get "/render/double_render", {}, "rails.raise_exceptions" => true + get "/render/double_render", {}, "action_dispatch.show_exceptions" => false end end end @@ -58,13 +58,13 @@ module Render test "raises an exception when a method of Object is called" do assert_raises(AbstractController::ActionNotFound) do - get "/render/blank_render/clone", {}, "rails.raise_exceptions" => true + get "/render/blank_render/clone", {}, "action_dispatch.show_exceptions" => false end end test "raises an exception when a private method is called" do assert_raises(AbstractController::ActionNotFound) do - get "/render/blank_render/secretz", {}, "rails.raise_exceptions" => true + get "/render/blank_render/secretz", {}, "action_dispatch.show_exceptions" => false end end end -- cgit v1.2.3