1
0
Fork 0
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:
Nathan Esquenazi 2013-02-25 21:04:13 -08:00 committed by Konstantin Haase
parent c9c0e552ed
commit b4126e4c97

View file

@ -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