aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-08-23 10:22:17 -0300
committerJosé Valim <jose.valim@gmail.com>2012-08-23 10:24:19 -0300
commite8eb68c19a423362f7c5fc3fea09803367d764d4 (patch)
tree5e97264d22cb2c77024711c696056a832ecee423 /railties/test/application/middleware
parent16fbe6f3e3f10d8f4bc72c3b7b9e5e35df2ee3a4 (diff)
downloadrails-e8eb68c19a423362f7c5fc3fea09803367d764d4.tar.gz
rails-e8eb68c19a423362f7c5fc3fea09803367d764d4.tar.bz2
rails-e8eb68c19a423362f7c5fc3fea09803367d764d4.zip
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.
Diffstat (limited to 'railties/test/application/middleware')
-rw-r--r--railties/test/application/middleware/exceptions_test.rb14
1 files changed, 4 insertions, 10 deletions
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