diff --git a/packages/ruby/server/test/fakeweb/json/1.json b/packages/ruby/server/test/fakeweb/json/1.json new file mode 100644 index 0000000..605a59d --- /dev/null +++ b/packages/ruby/server/test/fakeweb/json/1.json @@ -0,0 +1 @@ +[{"id":"1","place_of_revelation":"makkah","transliterated_name":"Al-Fatihah","translated_name":"The Opener","verse_count":7,"slug":"al-fatihah","codepoints":[1575,1604,1601,1575,1578,1581,1577]},[1,"بِسْمِ اللَّهِ الرَّحْمَـٰنِ الرَّحِيمِ"],[2,"الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ"],[3,"الرَّحْمَـٰنِ الرَّحِيمِ"],[4,"مَالِكِ يَوْمِ الدِّينِ"],[5,"إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ"],[6,"اهْدِنَا الصِّرَاطَ الْمُسْتَقِيمَ"],[7,"صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ الْمَغْضُوبِ عَلَيْهِمْ وَلَا الضَّالِّينَ"]] \ No newline at end of file diff --git a/packages/ruby/server/test/server_dir_test.rb b/packages/ruby/server/test/server_dir_test.rb index e8d44f4..3c852e3 100644 --- a/packages/ruby/server/test/server_dir_test.rb +++ b/packages/ruby/server/test/server_dir_test.rb @@ -35,6 +35,14 @@ class ServerDirTest < Test::Unit::TestCase last_response.content_length end + def test_json_file + get "/json/1.json" + assert_equal 200, last_response.status + assert_equal "application/json", last_response.content_type + assert_equal bytesize("./test/fakeweb/json/1.json"), + last_response.content_length + end + def test_permission_denied File.chmod 0, "./test/fakeweb/permission_denied.html" get "/permission_denied.html"