aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-15 19:43:49 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-15 19:43:49 +0100
commit26e7400cc5415dbce5e2c5d13da96ad8c25749e2 (patch)
tree956eceae5adddf3a1e7f1c5146d2cccf1aed27fa /railties/test
parent283a08763495a6b3ce0b196259ee1666f2b08cf1 (diff)
downloadrails-26e7400cc5415dbce5e2c5d13da96ad8c25749e2.tar.gz
rails-26e7400cc5415dbce5e2c5d13da96ad8c25749e2.tar.bz2
rails-26e7400cc5415dbce5e2c5d13da96ad8c25749e2.zip
Fix diagnostics page for routing errors.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/middleware/exceptions_test.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/railties/test/application/middleware/exceptions_test.rb b/railties/test/application/middleware/exceptions_test.rb
index 0174352900..d130d244c1 100644
--- a/railties/test/application/middleware/exceptions_test.rb
+++ b/railties/test/application/middleware/exceptions_test.rb
@@ -45,7 +45,7 @@ module ApplicationTests
assert_equal 404, last_response.status
end
- test "unspecified route when set action_dispatch.show_exceptions to false" do
+ test "unspecified route when action_dispatch.show_exceptions is not set raises an exception" do
app.config.action_dispatch.show_exceptions = false
assert_raise(ActionController::RoutingError) do
@@ -53,11 +53,22 @@ module ApplicationTests
end
end
- test "unspecified route when set action_dispatch.show_exceptions to true" do
+ test "unspecified route when action_dispatch.show_exceptions is set shows 404" do
app.config.action_dispatch.show_exceptions = true
assert_nothing_raised(ActionController::RoutingError) do
get '/foo'
+ assert_match "The page you were looking for doesn't exist.", last_response.body
+ end
+ end
+
+ test "unspecified route when action_dispatch.show_exceptions and consider_all_requests_local are set shows diagnostics" do
+ app.config.action_dispatch.show_exceptions = true
+ app.config.consider_all_requests_local = true
+
+ assert_nothing_raised(ActionController::RoutingError) do
+ get '/foo'
+ assert_match "No route matches", last_response.body
end
end