summaryrefslogtreecommitdiff
path: root/test/toxbank-investigation-rest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/toxbank-investigation-rest.rb')
-rw-r--r--test/toxbank-investigation-rest.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/toxbank-investigation-rest.rb b/test/toxbank-investigation-rest.rb
index 1dcc3d2..b3cc05a 100644
--- a/test/toxbank-investigation-rest.rb
+++ b/test/toxbank-investigation-rest.rb
@@ -34,7 +34,7 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
# create an investigation by uploading a zip file
def test_02_post_investigation
@@uri = ""
- file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1.zip"
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1b.zip"
#task_uri = `curl -k -X POST #{$toxbank_investigation[:uri]} -H "Content-Type: multipart/form-data" -F "file=@#{file};type=application/zip" -H "subjectid:#{@@subjectid}"`
response = OpenTox::RestClientWrapper.post $toxbank_investigation[:uri], {:file => File.open(file)}, { :subjectid => @@subjectid }
task_uri = response.chomp
@@ -42,14 +42,21 @@ class BasicTestCRUDInvestigation < Test::Unit::TestCase
task.wait
uri = task.resultURI
@@uri = URI(uri)
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
assert @@uri.host == URI($toxbank_investigation[:uri]).host
+ assert_match /[TBU\:U296]/, response
+ # POST zip on existing id
+ file = File.join File.dirname(__FILE__), "data/toxbank-investigation/valid", "BII-I-1.zip"
+ OpenTox::RestClientWrapper.post "#{@@uri}", {:file => File.open(file)}, { :subjectid => @@subjectid }
+ response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
+ assert_match /[TBU\:U115]/, response
end
# get investigation/{id}/metadata in rdf and check contents
def test_03_check_metadata
response = OpenTox::RestClientWrapper.get "#{@@uri}/metadata", {}, {:accept => "application/rdf+xml", :subjectid => @@subjectid}
assert_match /[Term Source Name, OBI, DOID, BTO, NEWT, UO, CHEBI, PATO, TBP, TBC, TBO, TBU, TBK]/, response
- assert_match /[Investigation Identifier, BII\-I\-1]/, response
+ assert_match /[Investigation Identifier, [BII\-I\-1]]/, response
assert_match /[Investigation Title, Growth control of the eukaryote cell\: a systems biology study in yeast]/, response
assert_match /[Investigation Description, Background Cell growth underlies many key cellular and developmental processes]/, response
assert_match /[Owning Organisation URI, TBO\:G176, Public]/, response