From ff3b8a71fc676762ce6649427a0a7e937788d2da Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 14 Mar 2014 11:51:29 +0100 Subject: added test for files_by_investigation template --- test/toxbank-investigation-sparql.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/toxbank-investigation-sparql.rb b/test/toxbank-investigation-sparql.rb index cd8aa97..643300c 100644 --- a/test/toxbank-investigation-sparql.rb +++ b/test/toxbank-investigation-sparql.rb @@ -249,7 +249,16 @@ class TBSPARQLTestExtended < MiniTest::Test assert factors.include?("dose:::0::::::http://purl.obolibrary.org/obo/UO_0000064:::micromolar:::UO:0000064") assert factors.include?("compound:::DOXORUBICIN:::http://purl.obolibrary.org/chebi/CHEBI:28748:::::::::") end - + + def test_05_files_by_investigation + response = OpenTox::RestClientWrapper.get "#{@@uri}/sparql/files_by_investigation", {}, {:accept => "application/json", :subjectid => $pi[:subjectid]} + result = JSON.parse(response) + #puts result + ["assay", "assayFile", "endpoint", "endpointLabel", "platform", "technology", "techLabel", "file", "term"].each do |v| + assert result["head"]["vars"].include?(v.to_s) + end + end + # Retrieves protocol URI containing any of the factor value URI (e.g. two compound URIs) def test_10_protocols_by_factors response = OpenTox::RestClientWrapper.get "#{$investigation[:uri]}/sparql/protocols_by_factors", {:factorValues => "['http://purl.obolibrary.org/chebi/CHEBI:28748']"}, {:accept => "application/json", :subjectid => $pi[:subjectid]} -- cgit v1.2.3