diff options
author | gebele <gebele@in-silico.ch> | 2015-08-14 15:34:24 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2015-08-14 15:34:24 +0200 |
commit | dd0300a2faac90f56a914824995f6dbfb5798a9a (patch) | |
tree | d0dc78b905bc7f40c7a13bb6bd2b3add3d632cd2 | |
parent | 58f2db84ccd3a25700192dc22b3d69dbc052c7ca (diff) |
extend assertions for biosearch result
-rw-r--r-- | test/toxbank-investigation-sparql.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb index 48ca418..72fc011 100644 --- a/test/toxbank-investigation-sparql.rb +++ b/test/toxbank-investigation-sparql.rb @@ -418,7 +418,13 @@ class TBSPARQLTestExtended < MiniTest::Test def test_22_biosearch_json # check the json output for a bio search gene response = OpenTox::RestClientWrapper.get "#{$investigation[:uri]}/sparql/biosearch", {:geneIdentifiers => "['entrez:3075']"}, {:accept => "application/json", :subjectid => $pi[:subjectid]} - assert response.include?("Entrez:3075") + result = JSON.parse(response) + #puts response + gene = result["results"]["bindings"].map{|n| "#{n["gene"]}"} + assert_equal 200, response.code + assert gene.include?("Entrez:3075") + title = result["results"]["bindings"].map{|n| "#{n["title"]["value"]}"} + assert title.include?("p-value'High.24hr-Control.24hr'") end # delete investigation/{id} |