summaryrefslogtreecommitdiff
path: root/test.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2009-08-13 18:27:58 +0200
committerChristoph Helma <helma@in-silico.de>2009-08-13 18:27:58 +0200
commitdea458e93411878cad2913bf7c56969fe7143c98 (patch)
tree3b91b527188c34bea0fe8bb883cb729d0571edfb /test.rb
parentba5360d03d1244fd54012420a20725cd33487fe9 (diff)
more methods fro feature/compound/retrieval, Rakefile with test and installation tasks
Diffstat (limited to 'test.rb')
-rw-r--r--test.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/test.rb b/test.rb
index 9d24a42..9995b94 100644
--- a/test.rb
+++ b/test.rb
@@ -1,5 +1,5 @@
ENV['RACK_ENV'] = 'test'
-require 'datasets'
+require 'application'
require 'test/unit'
require 'rack/test'
@@ -18,29 +18,25 @@ class DatasetsTest < Test::Unit::TestCase
def test_create_dataset
authorize "api", API_KEY
- post '/', :dataset_name => "Test dataset"
+ post '/', :name => "Test dataset"
assert last_response.ok?
assert_equal "http://example.org/1", last_response.body.chomp
end
def test_create_dataset_and_insert_data
authorize "api", API_KEY
- post '/', :dataset_name => "Test dataset"
- puts last_response.body
- put '/1', :feature_name => "New feature", :feature_value => "inactive", :compound_name => 'Benzene'
- puts last_response.body
- put '/1', :feature_name => "New feature", :feature_value => "active", :compound_name => 'Dioxin'
+ post '/', :name => "Test dataset"
+ post '/1', :compound_uri => "test_compound_uri", :feature_uri => "test_feature_uri"
get '/1'
- puts last_response.body.chomp
assert last_response.ok?
+ assert last_response.body.include?('Test dataset')
+ assert last_response.body.include?('test_compound_uri')
+ assert last_response.body.include?('test_feature_uri')
end
def test_unauthorized_create
- post '/', :dataset_name => "Test dataset", :feature_name => "Test feature", :file => File.new('tests/example.tab')
+ post '/', :name => "Test dataset"
assert !last_response.ok?
end
- def test_post_to_existing_dataset
- end
-
end