More test env tweaks + first collections api test
authorWard Vandewege <ward@clinicalfuture.com>
Mon, 21 Jan 2013 16:12:04 +0000 (11:12 -0500)
committerWard Vandewege <ward@clinicalfuture.com>
Mon, 21 Jan 2013 16:12:04 +0000 (11:12 -0500)
config/environments/test.rb
test/integration/collections_api_test.rb [new file with mode: 0644]

index 2f0aef8cc3c980b90095fa60bd097e8e2e9faf9b..728fc14dd21f7bb954aa566003fbeada65b1d6da 100644 (file)
@@ -43,11 +43,11 @@ Server::Application.configure do
 
   # config.compute_node_domain = `hostname --domain`.strip
 
+  # No need for SSL while testing
+  config.force_ssl = false
+
   # config.compute_node_nameservers = ['1.2.3.4', '1.2.3.5']
-  require 'net/http'
-  config.compute_node_nameservers = ['local', 'public'].collect do |iface|
-    Net::HTTP.get(URI("http://169.254.169.254/latest/meta-data/#{iface}-ipv4")).match(/^[\d\.]+$/)[0]
-  end << '172.16.0.23'
+  config.compute_node_nameservers = [ "172.16.0.23" ]
 
   config.uuid_prefix('test@' + `hostname`.strip)
 end
diff --git a/test/integration/collections_api_test.rb b/test/integration/collections_api_test.rb
new file mode 100644 (file)
index 0000000..7051c4c
--- /dev/null
@@ -0,0 +1,13 @@
+require 'test_helper'
+
+class CollectionsApiTest < ActionDispatch::IntegrationTest
+  fixtures :all
+
+  test "should get index" do
+    get "/orvos/v1/collections", :format => :json
+    @json_response ||= ActiveSupport::JSON.decode @response.body
+    assert_response :success
+    assert_equal "orvos#collectionList", @json_response['kind']
+  end
+
+end