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:
parent
86bc9ac094
commit
a51beb0346
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue