server: add javascript test

This commit is contained in:
0x1eef 2023-06-26 10:56:25 -03:00
parent 76b1d24669
commit e02115303c
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,3 @@
(function() {
console.log("Hello world");
})();

View file

@ -19,6 +19,14 @@ class ServerDirTest < Test::Unit::TestCase
last_response.content_length
end
def test_js_file
get "/js/index.js"
assert_equal 200, last_response.status
assert_equal "application/javascript", last_response.content_type
assert_equal bytesize("./test/fakeweb/js/index.js"),
last_response.content_length
end
def test_permission_denied
File.chmod 0, "./test/fakeweb/permission_denied.html"
get "/permission_denied.html"