зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-03 18:25:51 +03:00
Сравнить коммиты
3 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
72062c1a30 | ||
|
|
c4aa91225b | ||
|
|
3cc6edb302 |
@@ -1,4 +1,6 @@
|
|||||||
(function () {
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
// --- functions ---------------------------------------------------------------
|
// --- functions ---------------------------------------------------------------
|
||||||
function initQuillEditors() {
|
function initQuillEditors() {
|
||||||
let default_theme = 'snow'
|
let default_theme = 'snow'
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
module ActiveAdmin
|
module ActiveAdmin
|
||||||
module QuillEditor
|
module QuillEditor
|
||||||
VERSION = '0.2.12'
|
VERSION = '0.2.14'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -38,10 +38,11 @@ ActiveAdmin.register Post do
|
|||||||
end
|
end
|
||||||
|
|
||||||
form do |f|
|
form do |f|
|
||||||
|
toolbar = %w[bold italic underline link]
|
||||||
f.inputs 'Post' do
|
f.inputs 'Post' do
|
||||||
f.input :author
|
f.input :author
|
||||||
f.input :title
|
f.input :title
|
||||||
f.input :description, as: :quill_editor
|
f.input :description, as: :quill_editor, input_html: { data: { options: { modules: { toolbar: toolbar } } } }
|
||||||
f.input :category
|
f.input :category
|
||||||
f.input :dt
|
f.input :dt
|
||||||
f.input :position
|
f.input :position
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ RSpec.describe 'Quill editor', type: :system do
|
|||||||
it 'updates some HTML content' do
|
it 'updates some HTML content' do
|
||||||
visit "/admin/posts/#{post.id}/edit"
|
visit "/admin/posts/#{post.id}/edit"
|
||||||
|
|
||||||
|
%w[bold italic underline link].each do |button|
|
||||||
|
expect(page).to have_css(".ql-toolbar button.ql-#{button}")
|
||||||
|
end
|
||||||
|
expect(page).to have_css('#post_description[data-aa-quill-editor]')
|
||||||
expect(page).to have_css('#post_description_input .ql-editor', text: 'Some content...')
|
expect(page).to have_css('#post_description_input .ql-editor', text: 'Some content...')
|
||||||
find('#post_description_input .ql-editor').click
|
find('#post_description_input .ql-editor').click
|
||||||
find('#post_description_input .ql-editor').base.send_keys('more text')
|
find('#post_description_input .ql-editor').base.send_keys('more text')
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user