diff options
author | rautenberg <rautenberg@in-silico.ch> | 2014-06-02 09:44:16 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2014-06-02 09:44:16 +0200 |
commit | 95439e3c8dcf7cc4cfcd4b08b1e0fe5f83ccb25e (patch) | |
tree | 30a70a9875a42c3e46727a30767203efb984796c | |
parent | ae981387369f7501f6e935390a827b77017eedf4 (diff) |
add empty json test
-rw-r--r-- | test/toxbank-investigation-ftp.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/toxbank-investigation-ftp.rb b/test/toxbank-investigation-ftp.rb index 69702d8..a311cc4 100644 --- a/test/toxbank-investigation-ftp.rb +++ b/test/toxbank-investigation-ftp.rb @@ -52,7 +52,7 @@ class TBInvestigationFTP < MiniTest::Test end end - # check http://api.toxbank.net/index.php/Investigation#Get_a_list_of_uploaded_FTP_files + # validate json output def test_04_check_ftpfiles_json response = OpenTox::RestClientWrapper.get $investigation[:uri]+"/ftpfiles", {}, {:accept => "application/json", :subjectid => $pi[:subjectid] } assert_equal "200", response.code.to_s @@ -66,8 +66,15 @@ class TBInvestigationFTP < MiniTest::Test end end + # validate json output + def test_10_check_ftpfiles_json_empty + response = OpenTox::RestClientWrapper.get $investigation[:uri]+"/ftpfiles", {}, {:accept => "application/json", :subjectid => $guestid } + assert_equal "200", response.code.to_s + assert !!JSON.parse(response) + end + # delete file from test_02 - def test_04_delete_file + def test_95_delete_file $ftp.delete(File.basename($testfile)) assert_raises Net::FTPTempError do f = $ftp.list(File.basename($testfile)) |