mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Adds failing test for content-length and not_found
Signed-off-by: Konstantin Haase <konstantin.mailinglists@googlemail.com>
This commit is contained in:
parent
c9c0e552ed
commit
b4126e4c97
1 changed files with 13 additions and 0 deletions
|
@ -100,6 +100,19 @@ class RoutingTest < Test::Unit::TestCase
|
||||||
assert_equal "<h1>Not Found</h1>", response.body
|
assert_equal "<h1>Not Found</h1>", response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "recalculates body length correctly for 404 response" do
|
||||||
|
mock_app {
|
||||||
|
get '/' do
|
||||||
|
@response["Content-Length"] = "30"
|
||||||
|
raise Sinatra::NotFound
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
get "/"
|
||||||
|
assert_equal "18", response["Content-Length"]
|
||||||
|
assert_equal 404, status
|
||||||
|
end
|
||||||
|
|
||||||
it 'matches empty PATH_INFO to "/" if no route is defined for ""' do
|
it 'matches empty PATH_INFO to "/" if no route is defined for ""' do
|
||||||
mock_app do
|
mock_app do
|
||||||
get '/' do
|
get '/' do
|
||||||
|
|
Loading…
Reference in a new issue