mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Return an empty array if annotated_source_code is nil.
This commit is contained in:
parent
ac86921b2e
commit
b37b90251f
1 changed files with 0 additions and 26 deletions
|
@ -26,12 +26,6 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
||||||
class Boomer
|
class Boomer
|
||||||
attr_accessor :closed
|
attr_accessor :closed
|
||||||
|
|
||||||
class NilAnnotedSourceCodeError < StandardError
|
|
||||||
def annoted_source_code
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def initialize(detailed = false)
|
def initialize(detailed = false)
|
||||||
@detailed = detailed
|
@detailed = detailed
|
||||||
@closed = false
|
@closed = false
|
||||||
|
@ -60,10 +54,6 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_that_raises_nil_annoted_source_code
|
|
||||||
raise NilAnnotedSourceCodeError, "nil annoted_source_code"
|
|
||||||
end
|
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
env["action_dispatch.show_detailed_exceptions"] = @detailed
|
env["action_dispatch.show_detailed_exceptions"] = @detailed
|
||||||
req = ActionDispatch::Request.new(env)
|
req = ActionDispatch::Request.new(env)
|
||||||
|
@ -123,8 +113,6 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
||||||
raise_nested_exceptions
|
raise_nested_exceptions
|
||||||
when %r{/actionable_error}
|
when %r{/actionable_error}
|
||||||
raise CustomActionableError
|
raise CustomActionableError
|
||||||
when %r{/nil_annoted_source_code_error}
|
|
||||||
method_that_raises_nil_annoted_source_code
|
|
||||||
when "/utf8_template_error"
|
when "/utf8_template_error"
|
||||||
begin
|
begin
|
||||||
eval "“fancy string”"
|
eval "“fancy string”"
|
||||||
|
@ -744,20 +732,6 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
|
||||||
assert_match "ActionController::BadRequest", body
|
assert_match "ActionController::BadRequest", body
|
||||||
end
|
end
|
||||||
|
|
||||||
test "debug exceptions with misbehaving Exception#annoted_source_code" do
|
|
||||||
@app = DevelopmentApp
|
|
||||||
|
|
||||||
io = StringIO.new
|
|
||||||
logger = ActiveSupport::Logger.new(io)
|
|
||||||
|
|
||||||
get "/nil_annoted_source_code_error", headers: { "action_dispatch.show_exceptions" => true, "action_dispatch.logger" => logger }
|
|
||||||
|
|
||||||
assert_select "header h1", /DebugExceptionsTest::Boomer::NilAnnotedSourceCodeError/
|
|
||||||
assert_select "#container div.exception-message" do
|
|
||||||
assert_select "div", /nil annoted_source_code/
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
test "debug exceptions app shows diagnostics for template errors that contain UTF-8 characters" do
|
test "debug exceptions app shows diagnostics for template errors that contain UTF-8 characters" do
|
||||||
@app = DevelopmentApp
|
@app = DevelopmentApp
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue