|
|
|
@ -57,13 +57,7 @@ describe 'Upload attachment to budget', js: true do |
|
|
|
|
fill_in "Subject", with: 'New budget' |
|
|
|
|
|
|
|
|
|
# adding an image |
|
|
|
|
editor.in_editor do |container, editable| |
|
|
|
|
attachments.drag_and_drop_file(editable, image_fixture) |
|
|
|
|
|
|
|
|
|
# Besides testing caption functionality this also slows down clicking on the submit button |
|
|
|
|
# so that the image is properly embedded |
|
|
|
|
editable.find('figure.image figcaption').base.send_keys('Image uploaded on creation') |
|
|
|
|
end |
|
|
|
|
editor.drag_attachment image_fixture, 'Image uploaded on creation' |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('attachment-list-item', text: 'image.png') |
|
|
|
|
|
|
|
|
@ -77,13 +71,7 @@ describe 'Upload attachment to budget', js: true do |
|
|
|
|
click_on "Update" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
editor.in_editor do |container, editable| |
|
|
|
|
attachments.drag_and_drop_file(editable, image_fixture) |
|
|
|
|
|
|
|
|
|
# Besides testing caption functionality this also slows down clicking on the submit button |
|
|
|
|
# so that the image is properly embedded |
|
|
|
|
editable.find('figure.image figcaption').base.send_keys('Image uploaded the second time') |
|
|
|
|
end |
|
|
|
|
editor.drag_attachment image_fixture, 'Image uploaded the second time' |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('attachment-list-item', text: 'image.png', count: 2) |
|
|
|
|
|
|
|
|
|