UrlGenerationError are not catched as 404 anymore

This commit is contained in:
Jean Boussier 2014-07-19 10:32:48 -04:00
parent 89397d09eb
commit 8e1362be3f
2 changed files with 16 additions and 1 deletions

@ -25,7 +25,7 @@ def initialize(message, failures=[])
end
end
class ActionController::UrlGenerationError < RoutingError #:nodoc:
class ActionController::UrlGenerationError < ActionControllerError #:nodoc:
end
class MethodNotAllowed < ActionControllerError #:nodoc:

@ -60,6 +60,21 @@ def index
assert_equal "YOU FAILED BRO", last_response.body
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
app.config.action_dispatch.show_exceptions = false