server: add image file test

This commit is contained in:
0x1eef 2023-06-27 04:36:12 -03:00
parent e02115303c
commit 092d3ec623
2 changed files with 8 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View file

@ -27,6 +27,14 @@ class ServerDirTest < Test::Unit::TestCase
last_response.content_length
end
def test_png_file
get "/images/0x1eef.png"
assert_equal 200, last_response.status
assert_equal "image/png", last_response.content_type
assert_equal bytesize("./test/fakeweb/images/0x1eef.png"),
last_response.content_length
end
def test_permission_denied
File.chmod 0, "./test/fakeweb/permission_denied.html"
get "/permission_denied.html"