提交 8e1362be 编写于 作者: J Jean Boussier

UrlGenerationError are not catched as 404 anymore

上级 89397d09
...@@ -25,7 +25,7 @@ def initialize(message, failures=[]) ...@@ -25,7 +25,7 @@ def initialize(message, failures=[])
end end
end end
class ActionController::UrlGenerationError < RoutingError #:nodoc: class ActionController::UrlGenerationError < ActionControllerError #:nodoc:
end end
class MethodNotAllowed < ActionControllerError #:nodoc: class MethodNotAllowed < ActionControllerError #:nodoc:
......
...@@ -60,6 +60,21 @@ def index ...@@ -60,6 +60,21 @@ def index
assert_equal "YOU FAILED BRO", last_response.body assert_equal "YOU FAILED BRO", last_response.body
end end
test "url generation error when action_dispatch.show_exceptions is set raises an exception" do
controller :foo, <<-RUBY
class FooController < ActionController::Base
def index
raise ActionController::UrlGenerationError
end
end
RUBY
app.config.action_dispatch.show_exceptions = true
get '/foo'
assert_equal 500, last_response.status
end
test "unspecified route when action_dispatch.show_exceptions is not set raises an exception" do test "unspecified route when action_dispatch.show_exceptions is not set raises an exception" do
app.config.action_dispatch.show_exceptions = false app.config.action_dispatch.show_exceptions = false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册