X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b2addc8887d200219b44121c87a7a44bf4566e42..c8b119d10b41cd507a6677d4feab7974362a153e:/services/api/test/functional/arvados/v1/groups_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb index 37b606409e..2b5e8d5a9d 100644 --- a/services/api/test/functional/arvados/v1/groups_controller_test.rb +++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb @@ -431,7 +431,7 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase end test 'get contents with jobs and pipeline instances disabled' do - Rails.configuration.disable_api_methods = ['jobs.index', 'pipeline_instances.index'] + Rails.configuration.API.DisabledAPIs = {'jobs.index'=>{}, 'pipeline_instances.index'=>{}} authorize_with :active get :contents, params: { @@ -444,7 +444,7 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase test 'get contents with low max_index_database_read' do # Some result will certainly have at least 12 bytes in a # restricted column - Rails.configuration.max_index_database_read = 12 + Rails.configuration.API.MaxIndexDatabaseRead = 12 authorize_with :active get :contents, params: { id: groups(:aproject).uuid, @@ -505,9 +505,19 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase ### trashed project tests ### - [:active, :admin].each do |auth| + # + # The structure is + # + # trashed_project (zzzzz-j7d0g-trashedproject1) + # trashed_subproject (zzzzz-j7d0g-trashedproject2) + # trashed_subproject3 (zzzzz-j7d0g-trashedproject3) + # zzzzz-xvhdp-cr5trashedcontr + + [:active, + :admin].each do |auth| # project: to query, to untrash, is visible, parent contents listing success - [[:trashed_project, [], false, true], + [ + [:trashed_project, [], false, true], [:trashed_project, [:trashed_project], true, true], [:trashed_subproject, [], false, false], [:trashed_subproject, [:trashed_project], true, true], @@ -591,6 +601,23 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase end end + test "show include_trash=false #{project} #{untrash} as #{auth}" do + authorize_with auth + untrash.each do |pr| + Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false + end + get :show, params: { + id: groups(project).uuid, + format: :json, + include_trash: false + } + if visible + assert_response :success + else + assert_response 404 + end + end + test "show include_trash #{project} #{untrash} as #{auth}" do authorize_with auth untrash.each do |pr|