X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/15c688d1c4b41232536d0a275dd5c0fdb8879a00..c2aceca339ec3a6f3d853865cebd0efe348ff518:/services/api/test/functional/arvados/v1/collections_controller_test.rb?ds=sidebyside 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 4e8b0559aa..1ca2dd1dc1 100644 --- a/services/api/test/functional/arvados/v1/collections_controller_test.rb +++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb @@ -1128,18 +1128,24 @@ EOS end end - test 'get trashed collection with include_trash' do - uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection - authorize_with :active - get :show, params: { - id: uuid, - include_trash: true, - } - assert_response 200 + [true, false].each do |include_trash| + test "get trashed collection with include_trash=#{include_trash}" do + uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection + authorize_with :active + get :show, params: { + id: uuid, + include_trash: include_trash, + } + if include_trash + assert_response 200 + else + assert_response 404 + end + end end [:admin, :active].each do |user| - test "get trashed collection via filters and #{user} user" do + test "get trashed collection via filters and #{user} user without including its past versions" do uuid = 'zzzzz-4zz18-mto52zx1s7sn3ih' # expired_collection authorize_with user get :index, params: { @@ -1382,6 +1388,16 @@ EOS json_response['name'] end + test 'can get old version collection by PDH' do + authorize_with :active + get :show, params: { + id: collections(:collection_owned_by_active_past_version_1).portable_data_hash, + } + assert_response :success + assert_equal collections(:collection_owned_by_active_past_version_1).portable_data_hash, + json_response['portable_data_hash'] + end + test 'version and current_version_uuid are ignored at creation time' do permit_unsigned_manifests authorize_with :active