diff --git a/spec/dummy/app/admin/posts.rb b/spec/dummy/app/admin/posts.rb index 9d1cb11..f600562 100644 --- a/spec/dummy/app/admin/posts.rb +++ b/spec/dummy/app/admin/posts.rb @@ -38,10 +38,11 @@ ActiveAdmin.register Post do end form do |f| + toolbar = %w[bold italic underline link] f.inputs 'Post' do f.input :author 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 :dt f.input :position diff --git a/spec/system/quill_editor_spec.rb b/spec/system/quill_editor_spec.rb index 6de97cb..b5f1148 100644 --- a/spec/system/quill_editor_spec.rb +++ b/spec/system/quill_editor_spec.rb @@ -17,6 +17,10 @@ RSpec.describe 'Quill editor', type: :system do it 'updates some HTML content' do 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...') find('#post_description_input .ql-editor').click find('#post_description_input .ql-editor').base.send_keys('more text')