summaryrefslogtreecommitdiff
path: root/spec/features/uploads/user_uploads_file_to_note_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/uploads/user_uploads_file_to_note_spec.rb')
-rw-r--r--spec/features/uploads/user_uploads_file_to_note_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/features/uploads/user_uploads_file_to_note_spec.rb b/spec/features/uploads/user_uploads_file_to_note_spec.rb
index 1261ffdc2ee..972c10aaf23 100644
--- a/spec/features/uploads/user_uploads_file_to_note_spec.rb
+++ b/spec/features/uploads/user_uploads_file_to_note_spec.rb
@@ -21,16 +21,12 @@ feature 'User uploads file to note' do
end
context 'uploading is in progress' do
- it 'shows "Cancel" button on uploading', :js do
- dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
-
- expect(page).to have_button('Cancel')
- end
-
it 'cancels uploading on clicking to "Cancel" button', :js do
- dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
+ slow_requests do
+ dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
- click_button 'Cancel'
+ click_button 'Cancel'
+ end
expect(page).to have_button('Attach a file')
expect(page).not_to have_button('Cancel')
@@ -38,16 +34,20 @@ feature 'User uploads file to note' do
end
it 'shows "Attaching a file" message on uploading 1 file', :js do
- dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
+ slow_requests do
+ dropzone_file([Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
- expect(page).to have_selector('.attaching-file-message', visible: true, text: 'Attaching a file -')
+ expect(page).to have_selector('.attaching-file-message', visible: true, text: 'Attaching a file -')
+ end
end
it 'shows "Attaching 2 files" message on uploading 2 file', :js do
- dropzone_file([Rails.root.join('spec', 'fixtures', 'video_sample.mp4'),
- Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
+ slow_requests do
+ dropzone_file([Rails.root.join('spec', 'fixtures', 'video_sample.mp4'),
+ Rails.root.join('spec', 'fixtures', 'dk.png')], 0, false)
- expect(page).to have_selector('.attaching-file-message', visible: true, text: 'Attaching 2 files -')
+ expect(page).to have_selector('.attaching-file-message', visible: true, text: 'Attaching 2 files -')
+ end
end
it 'shows error message, "retry" and "attach a new file" link a if file is too big', :js do