X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9997ada67ce36d2fbe831bce473aa61250727aff..a31587cba5c2c38e0fc4f91981baf8bf2605664c:/apps/workbench/test/integration_helper.rb diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb index efe6bd2b33..5fbdd5c6f0 100644 --- a/apps/workbench/test/integration_helper.rb +++ b/apps/workbench/test/integration_helper.rb @@ -221,6 +221,8 @@ class ActionDispatch::IntegrationTest end if Capybara.current_driver == :selenium page.execute_script("window.localStorage.clear()") + else + page.driver.restart if defined?(page.driver.restart) end Capybara.reset_sessions! end @@ -240,3 +242,19 @@ class ActionDispatch::IntegrationTest end end end + +def upload_data_and_get_collection(data, user, filename, owner_uuid=nil) + token = api_token(user) + 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