Skip to content

Commit

Permalink
Merge pull request #78 from opf/fix/attachments
Browse files Browse the repository at this point in the history
Use core attachment helper
  • Loading branch information
oliverguenther authored Oct 29, 2018
2 parents 9f560f7 + cce82ae commit e9eb516
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions spec/features/attachment_upload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@
fill_in "Title", with: 'New documentation'

# 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')

Expand All @@ -83,14 +77,7 @@
click_on 'Edit'
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)

click_on 'Save'
Expand Down

0 comments on commit e9eb516

Please sign in to comment.