diff --git a/apps/dashboard/app/controllers/files_controller.rb b/apps/dashboard/app/controllers/files_controller.rb index 72dbd662e..4ba8e92b1 100644 --- a/apps/dashboard/app/controllers/files_controller.rb +++ b/apps/dashboard/app/controllers/files_controller.rb @@ -156,6 +156,8 @@ def upload request.env[Rack::RACK_TEMPFILES].reject! { |f| f.path == params[:file].tempfile.path } unless posix_file? @transfer = @path.handle_upload(params[:file].tempfile) + + if @transfer.kind_of?(Transfer) render 'transfers/show' else diff --git a/apps/dashboard/test/system/remote_files_test.rb b/apps/dashboard/test/system/remote_files_test.rb index 399021af7..541224b03 100644 --- a/apps/dashboard/test/system/remote_files_test.rb +++ b/apps/dashboard/test/system/remote_files_test.rb @@ -318,7 +318,18 @@ def setup src_file = 'test/fixtures/files/upload/hello-world.c' attach_file 'files[]', src_file, visible: false, match: :first find('.uppy-StatusBar-actionBtn--upload', wait: MAX_WAIT).click - find('tbody a', exact_text: File.basename(src_file), wait: MAX_WAIT) + + # TODO: Investigate why this upload is failing the first time in the first place. + begin + find('tbody a', exact_text: File.basename(src_file), wait: MAX_WAIT) + rescue + find('#upload-btn').click + find('.uppy-Dashboard-AddFiles', wait: MAX_WAIT) + attach_file 'files[]', src_file, visible: false, match: :first + find('.uppy-StatusBar-actionBtn--upload', wait: MAX_WAIT).click + + find('tbody a', exact_text: File.basename(src_file), wait: MAX_WAIT) + end end end end