X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/da2803a65e696bf85883e82a0bda6ef81dda5429..6fb5d2bd10901a1e0ced4ea8849419145d47a0b5:/services/api/test/functional/arvados/v1/collections_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb index 78a627ad1a..575eda3d92 100644 --- a/services/api/test/functional/arvados/v1/collections_controller_test.rb +++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb @@ -9,6 +9,28 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase assert_not_nil assigns(:objects) end + [0,1,2].each do |limit| + test "get index with limit=#{limit}" do + authorize_with :active + get :index, limit: limit + assert_response :success + assert_equal limit, assigns(:objects).count + resp = JSON.parse(@response.body) + assert_equal limit, resp['limit'] + end + end + + test "get index with limit=2 offset=99999" do + # Assume there are not that many test fixtures. + authorize_with :active + get :index, limit: 2, offset: 99999 + assert_response :success + assert_equal 0, assigns(:objects).count + resp = JSON.parse(@response.body) + assert_equal 2, resp['limit'] + assert_equal 99999, resp['offset'] + end + test "should create" do authorize_with :active test_collection = {