From dd0300a2faac90f56a914824995f6dbfb5798a9a Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 14 Aug 2015 15:34:24 +0200 Subject: extend assertions for biosearch result --- test/toxbank-investigation-sparql.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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} -- cgit v1.2.3