Merge branch 'master' of git.clinicalfuture.com:arvados
[arvados.git] / services / api / test / functional / arvados / v1 / collections_controller_test.rb
index 9cbdc0b6f1d81c02094f3507749ca4f694a46b67..6990e97413e031edeaf649d3d6e22cc89bd3cc7c 100644 (file)
@@ -27,7 +27,7 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
     resp = JSON.parse(@response.body)
     assert_equal resp['items_available'], assigns(:objects).length
     assert_equal resp['items_available'], resp['items'].count
-    unique_uuids = resp['items'].collect { |i| i['uuid'] }.compact
+    unique_uuids = resp['items'].collect { |i| i['uuid'] }.compact.uniq
     assert_equal unique_uuids.count, resp['items'].count
   end
 
@@ -209,4 +209,15 @@ EOS
     assert_nil resp['1f4b0bc7583c2a7f9102c395f4ffc5e3+45'] # foo
   end
 
+  test "search collections with 'any' operator" do
+    authorize_with :active
+    get :index, {
+      where: { any: ['contains', '7f9102c395f4ffc5e3'] }
+    }
+    assert_response :success
+    found = assigns(:objects).collect(&:uuid)
+    assert_equal 1, found.count
+    assert_equal true, !!found.index('1f4b0bc7583c2a7f9102c395f4ffc5e3+45')
+  end
+
 end