1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

added test for #500

This commit is contained in:
Konstantin Haase 2013-02-26 15:59:47 +11:00
parent 86bc9ac094
commit a51beb0346

View file

@ -303,6 +303,18 @@ class HelpersTest < Test::Unit::TestCase
assert_equal 'error handler', body
end
it 'should not reset the content-type to html for error handlers' do
mock_app do
disable :raise_errors
before { content_type "application/json;charset=utf-8" }
not_found { JSON.dump("error" => "Not Found") }
end
get '/'
assert_equal 404, status
assert_equal 'application/json;charset=utf-8', response.content_type
end
it 'should not invoke error handler when halting with 500 inside an error handler' do
mock_app do
disable :raise_errors