X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4e1dda28351f6b7aa91aa6baca8805e283f2694b..ecf6627111838530f64ffcd689e11d987cc7bf2f:/services/api/test/integration/permissions_test.rb diff --git a/services/api/test/integration/permissions_test.rb b/services/api/test/integration/permissions_test.rb index 274e8f166b..49fa473b6b 100644 --- a/services/api/test/integration/permissions_test.rb +++ b/services/api/test/integration/permissions_test.rb @@ -1,6 +1,12 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' class PermissionsTest < ActionDispatch::IntegrationTest + include DbCurrentTime + include CurrentApiClient # for empty_collection fixtures :users, :groups, :api_client_authorizations, :collections test "adding and removing direct can_read links" do @@ -340,11 +346,6 @@ class PermissionsTest < ActionDispatch::IntegrationTest assert_response 404 end - test "get_permissions returns 404 for unreadable uuid" do - get "/arvados/v1/permissions/#{groups(:public).uuid}", nil, auth(:active) - assert_response 404 - end - test "get_permissions returns 403 if user can read but not manage" do post "/arvados/v1/links", { :link => { @@ -360,4 +361,14 @@ class PermissionsTest < ActionDispatch::IntegrationTest get "/arvados/v1/permissions/#{groups(:public).uuid}", nil, auth(:active) assert_response 403 end + + test "active user can read the empty collection" do + # The active user should be able to read the empty collection. + + get("/arvados/v1/collections/#{empty_collection_uuid}", + { :format => :json }, + auth(:active)) + assert_response :success + assert_empty json_response['manifest_text'], "empty collection manifest_text is not empty" + end end