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

Use core attachment helper #78

Merged
merged 1 commit into from
Oct 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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