Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3994 - fixes remote files test #3995

Merged
merged 11 commits into from
Dec 9, 2024
2 changes: 2 additions & 0 deletions apps/dashboard/app/controllers/files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion apps/dashboard/test/system/remote_files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading