From 9730a65ede06cbdae03652b6a26470c14da6bd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 29 Oct 2018 14:59:16 +0100 Subject: [PATCH] Use core attachment helper: https://github.com/opf/openproject/pull/6790 --- spec/features/budgets/attachment_upload_spec.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/spec/features/budgets/attachment_upload_spec.rb b/spec/features/budgets/attachment_upload_spec.rb index 510f6909d7..390427458b 100644 --- a/spec/features/budgets/attachment_upload_spec.rb +++ b/spec/features/budgets/attachment_upload_spec.rb @@ -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)