Files
nairobi/spec/features/ckeditor_spec.rb
Javi Martín d19abd7ddb Fix uploading images through CKEditor's upload tab
The bug was introduced when we upgraded the ckeditor gem in commit
f240e007.
2020-01-17 21:52:21 +01:00

34 lines
883 B
Ruby

require "rails_helper"
describe "CKEditor" do
scenario "is present before & after turbolinks update page", :js do
author = create(:user)
login_as(author)
visit new_debate_path
expect(page).to have_css ".translatable-fields[data-locale='en'] .cke_wysiwyg_frame"
click_link "Debates"
click_link "Start a debate"
expect(page).to have_css ".translatable-fields[data-locale='en'] .cke_wysiwyg_frame"
end
scenario "uploading an image through the upload tab", :js do
login_as(create(:administrator).user)
visit new_admin_site_customization_page_path
find(".cke_button__image").click
click_link "Upload"
within_frame(1) do
attach_file "Send it to the Server", Rails.root.join("spec/fixtures/files/clippy.jpg")
end
click_link "Send it to the Server"
expect(page).to have_css "img[src$='clippy.jpg']"
end
end