X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cec09589e50ced6d0b7a0d90d5ca124241d4a58a..d4cc835615a729c33460c6bb2ad8976808674a5c:/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 fb80f8874e..4745d1b9ac 100644 --- a/apps/workbench/test/functional/collections_controller_test.rb +++ b/apps/workbench/test/functional/collections_controller_test.rb @@ -1,6 +1,8 @@ require 'test_helper' class CollectionsControllerTest < ActionController::TestCase + NONEXISTENT_COLLECTION = "ffffffffffffffffffffffffffffffff+0" + def collection_params(collection_name, file_name=nil) uuid = api_fixture('collections')[collection_name.to_s]['uuid'] params = {uuid: uuid, id: uuid} @@ -98,6 +100,14 @@ class CollectionsControllerTest < ActionController::TestCase assert_no_session end + test "reader token Collection links end with trailing slash" do + # Testing the fix for #2937. + show_collection(:foo_file, :active_trustedclient) + post(:share, collection_params(:foo_file)) + assert(@controller.download_link.ends_with? '/', + "Collection share link does not end with slash for wget") + end + test "getting a file from Keep" do params = collection_params(:foo_file, 'foo') sess = session_for(:active) @@ -165,4 +175,9 @@ class CollectionsControllerTest < ActionController::TestCase "when showing the user agreement.") assert_response :success end + + test "requesting nonexistent Collection returns 404" do + show_collection({uuid: NONEXISTENT_COLLECTION, id: NONEXISTENT_COLLECTION}, + :active, 404) + end end