X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/aa2adbcaa06c4f5dc7a6e54f3d9a5148b20fbbb1..72cf9a5814e52adb2b6c2f349cbef3de069722bb:/apps/workbench/test/functional/projects_controller_test.rb?ds=sidebyside diff --git a/apps/workbench/test/functional/projects_controller_test.rb b/apps/workbench/test/functional/projects_controller_test.rb index d76430cfdf..93f794d900 100644 --- a/apps/workbench/test/functional/projects_controller_test.rb +++ b/apps/workbench/test/functional/projects_controller_test.rb @@ -93,6 +93,35 @@ class ProjectsControllerTest < ActionController::TestCase refute user_can_manage(:project_viewer, "asubproject") end + test "subproject_admin can_manage asubproject" do + assert user_can_manage(:subproject_admin, "asubproject") + end + + test "detect ownership loop in project breadcrumbs" do + # This test has an arbitrary time limit -- otherwise we'd just sit + # here forever instead of reporting that the loop was not + # detected. The test passes quickly, but fails slowly. + Timeout::timeout 10 do + get(:show, + { id: api_fixture("groups")["project_owns_itself"]["uuid"] }, + session_for(:admin)) + end + assert_response :success + end + + test "project admin can remove items from the project" do + coll_key = "collection_to_remove_from_subproject" + coll_uuid = api_fixture("collections")[coll_key]["uuid"] + delete(:remove_item, + { id: api_fixture("groups")["asubproject"]["uuid"], + item_uuid: coll_uuid, + format: "js" }, + session_for(:subproject_admin)) + assert_response :success + assert_match(/\b#{coll_uuid}\b/, @response.body, + "removed object not named in response") + end + test 'projects#show tab infinite scroll partial obeys limit' do get_contents_rows(limit: 1, filters: [['uuid','is_a',['arvados#job']]]) assert_response :success