Files
nairobi/spec/features/ckeditor_spec.rb
Senén Rodero Rodríguez 7466148408 Deactivate ckeditor file uploads feature
This feature was not working so its better to disable it completely.

By removing attachment_files endpoints related buttons and tabs from ckeditor UI are not shown to users anymore.
2020-04-18 09:21:25 +02:00

45 lines
1.2 KiB
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
scenario "cannot upload attachments through link tab", :js do
login_as(create(:administrator).user)
visit new_admin_site_customization_page_path
find(".cke_button__link").click
expect(page).to have_css(".cke_dialog")
expect(page).not_to have_link "Upload"
expect(page).not_to have_link "Browse Server"
end
end