Test no duplicate UUIDs are returned by collections.list.
[arvados.git] / services / api / test / functional / arvados / v1 / collections_controller_test.rb
index 575eda3d929204beb23f54b0aef0710e51be44a2..9cbdc0b6f1d81c02094f3507749ca4f694a46b67 100644 (file)
@@ -20,6 +20,17 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
     end
   end
 
+  test "items.count == items_available" do
+    authorize_with :active
+    get :index, limit: 100000
+    assert_response :success
+    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
+    assert_equal unique_uuids.count, resp['items'].count
+  end
+
   test "get index with limit=2 offset=99999" do
     # Assume there are not that many test fixtures.
     authorize_with :active