From e8eb68c19a423362f7c5fc3fea09803367d764d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 23 Aug 2012 10:22:17 -0300 Subject: Fix failure on middleware/exceptions_test The reason the test was failing was because when the test invokes `app.config`, the app is loaded and, as `eager_load` is set to true, it disables the dependency loading mechanism, so controllers that are later defined are not loaded. --- railties/test/application/middleware/exceptions_test.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'railties/test/application/middleware/exceptions_test.rb') diff --git a/railties/test/application/middleware/exceptions_test.rb b/railties/test/application/middleware/exceptions_test.rb index d1a614e181..42096cfec4 100644 --- a/railties/test/application/middleware/exceptions_test.rb +++ b/railties/test/application/middleware/exceptions_test.rb @@ -88,9 +88,6 @@ module ApplicationTests end test "displays diagnostics message when exception raised in template that contains UTF-8" do - app.config.action_dispatch.show_exceptions = true - app.config.consider_all_requests_local = true - controller :foo, <<-RUBY class FooController < ActionController::Base def index @@ -98,18 +95,15 @@ module ApplicationTests end RUBY + app.config.action_dispatch.show_exceptions = true + app.config.consider_all_requests_local = true + app_file 'app/views/foo/index.html.erb', <<-ERB <% raise 'boooom' %> ✓測試テスト시험 ERB - app_file 'config/routes.rb', <<-RUBY - AppTemplate::Application.routes.draw do - post ':controller(/:action)' - end - RUBY - - post '/foo', :utf8 => '✓' + get '/foo', :utf8 => '✓' assert_match(/boooom/, last_response.body) assert_match(/測試テスト시험/, last_response.body) end -- cgit v1.2.3