Bring back CKEditor images button
It was accidentally deleted in commit 914bfa6.
Note the following spec passes on my machine if we add a `sleep 0.1`
call in the `:wait_readable` part of ruby's `Net::Protocol#rbuf_fill`.
Otherwise, it hangs forever after clicking the `.fileupload-file` div,
which closes its window. It might be solved when upgrading rails,
capybara, selenium or chromedriver.
scenario "Allows images in CKEditor", :js do
visit edit_admin_site_customization_page_path(custom_page)
within(".ckeditor") do
within_frame(0) { expect(page).not_to have_css("img") }
expect(page).to have_css(".cke_toolbar .cke_button__image_icon")
find(".cke_toolbar .cke_button__image_icon").click
end
within_window(window_opened_by { click_link "Browse Server" }) do
attach_file :file,
Rails.root.join('spec/fixtures/files/clippy.jpg'),
visible: false
find(".fileupload-file").click
end
click_link "OK"
within(".ckeditor") do
within_frame(0) { expect(page).to have_css("img") }
end
end
This commit is contained in:
@@ -41,7 +41,8 @@
|
||||
<%= f.translatable_text_field :title %>
|
||||
<%= f.translatable_text_field :subtitle %>
|
||||
<div class="ckeditor">
|
||||
<%= f.translatable_cktext_area :content %>
|
||||
<%= f.translatable_cktext_area :content,
|
||||
ckeditor: { language: I18n.locale, toolbar: "admin" } %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-3 margin-top">
|
||||
<%= f.submit class: "button success expanded" %>
|
||||
|
||||
@@ -41,8 +41,11 @@ feature "Admin custom pages" do
|
||||
end
|
||||
|
||||
context "Update" do
|
||||
scenario "Valid custom page" do
|
||||
let!(:custom_page) do
|
||||
create(:site_customization_page, title: "An example custom page", slug: "custom-example-page")
|
||||
end
|
||||
|
||||
scenario "Valid custom page" do
|
||||
visit admin_root_path
|
||||
|
||||
within("#side_menu") do
|
||||
@@ -62,6 +65,14 @@ feature "Admin custom pages" do
|
||||
expect(page).to have_content "Another example custom page"
|
||||
expect(page).to have_content "another-custom-example-page"
|
||||
end
|
||||
|
||||
scenario "Allows images in CKEditor", :js do
|
||||
visit edit_admin_site_customization_page_path(custom_page)
|
||||
|
||||
within(".ckeditor") do
|
||||
expect(page).to have_css(".cke_toolbar .cke_button__image_icon")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Delete" do
|
||||
|
||||
Reference in New Issue
Block a user