X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/27ffca811e6f43225fc82d582d1962eebbd1ab6e..783343e5aca00f730315d943cecf74e4277a38e7:/apps/workbench/test/functional/collections_controller_test.rb diff --git a/apps/workbench/test/functional/collections_controller_test.rb b/apps/workbench/test/functional/collections_controller_test.rb index 19d08d73b3..fb80f8874e 100644 --- a/apps/workbench/test/functional/collections_controller_test.rb +++ b/apps/workbench/test/functional/collections_controller_test.rb @@ -53,11 +53,11 @@ class CollectionsControllerTest < ActionController::TestCase assert_equal([['.', 'foo', 3]], assigns(:object).files) end - test "viewing a collection fetches related folders" do + test "viewing a collection fetches related projects" do show_collection(:foo_file, :active) - assert_includes(assigns(:folders).map(&:uuid), - api_fixture('groups')['afolder']['uuid'], - "controller did not find linked folder") + assert_includes(assigns(:projects).map(&:uuid), + api_fixture('groups')['aproject']['uuid'], + "controller did not find linked project") end test "viewing a collection fetches related permissions" do @@ -153,4 +153,16 @@ class CollectionsControllerTest < ActionController::TestCase assert_not_equal(read_token, session[:arvados_api_token], "using a reader token set the session's API token") end + + test "inactive user can retrieve user agreement" do + ua_collection = api_fixture('collections')['user_agreement'] + get :show_file, { + uuid: ua_collection['uuid'], + file: ua_collection['manifest_text'].match(/ \d+:\d+:(\S+)/)[1] + }, session_for(:inactive) + assert_nil(assigns(:required_user_agreements), + "Did not skip check_user_agreements filter " + + "when showing the user agreement.") + assert_response :success + end end