X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0eb72b526bf8bbb011551ecf019f604e17a534f1..56776607fe1846810bb0396216e09ec09845b426:/apps/workbench/test/integration_helper.rb diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb index 5d2cefe447..ef2779cc3e 100644 --- a/apps/workbench/test/integration_helper.rb +++ b/apps/workbench/test/integration_helper.rb @@ -163,7 +163,6 @@ module KeepWebConfig @kwdport = getport 'keep-web-dl-ssl' Rails.configuration.keep_web_url = "https://localhost:#{@kwport}/c=%{uuid_or_pdh}" Rails.configuration.keep_web_download_url = "https://localhost:#{@kwdport}/c=%{uuid_or_pdh}" - CollectionsController.any_instance.expects(:file_enumerator).never end end @@ -241,3 +240,19 @@ class ActionDispatch::IntegrationTest end end end + +def upload_data_and_get_collection(data, user, filename, owner_uuid=nil) + token = api_fixture('api_client_authorizations')[user]['api_token'] + datablock = `echo -n #{data.shellescape} | ARVADOS_API_TOKEN=#{token.shellescape} arv-put --no-progress --raw -`.strip + assert $?.success?, $? + col = nil + use_token user do + mtxt = ". #{datablock} 0:#{data.length}:#{filename}\n" + if owner_uuid + col = Collection.create(manifest_text: mtxt, owner_uuid: owner_uuid) + else + col = Collection.create(manifest_text: mtxt) + end + end + return col +end