server: add json file test
This commit is contained in:
parent
092d3ec623
commit
3fddb22b02
2 changed files with 9 additions and 0 deletions
1
packages/ruby/server/test/fakeweb/json/1.json
Normal file
1
packages/ruby/server/test/fakeweb/json/1.json
Normal file
|
@ -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,"صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ الْمَغْضُوبِ عَلَيْهِمْ وَلَا الضَّالِّينَ"]]
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue