4024: Test that items_available takes filters into account.
authorTom Clegg <tom@curoverse.com>
Fri, 7 Nov 2014 22:36:52 +0000 (17:36 -0500)
committerTom Clegg <tom@curoverse.com>
Fri, 7 Nov 2014 22:36:52 +0000 (17:36 -0500)
services/api/test/functional/arvados/v1/collections_controller_test.rb

index e5b17dd965c534ac536d88af87610d95ad424fcf..b46bfe8555ba69a7525503b82a13b2bee65aa4b0 100644 (file)
@@ -68,6 +68,18 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
     assert_equal unique_uuids.count, resp['items'].count
   end
 
+  test "items.count == items_available with filters" do
+    authorize_with :active
+    get :index, {
+      limit: 100,
+      filters: [['uuid','=',collections(:foo_file).uuid]]
+    }
+    assert_response :success
+    assert_equal 1, assigns(:objects).length
+    assert_equal 1, json_response['items_available']
+    assert_equal 1, json_response['items'].count
+  end
+
   test "get index with limit=2 offset=99999" do
     # Assume there are not that many test fixtures.
     authorize_with :active