Skip to content

Commit c4aa912

Browse files
committed
Minor specs improvement
1 parent 3cc6edb commit c4aa912

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/dummy/app/admin/posts.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
end
3939

4040
form do |f|
41+
toolbar = %w[bold italic underline link]
4142
f.inputs 'Post' do
4243
f.input :author
4344
f.input :title
44-
f.input :description, as: :quill_editor
45+
f.input :description, as: :quill_editor, input_html: { data: { options: { modules: { toolbar: toolbar } } } }
4546
f.input :category
4647
f.input :dt
4748
f.input :position

spec/system/quill_editor_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
it 'updates some HTML content' do
1818
visit "/admin/posts/#{post.id}/edit"
1919

20+
%w[bold italic underline link].each do |button|
21+
expect(page).to have_css(".ql-toolbar button.ql-#{button}")
22+
end
23+
expect(page).to have_css('#post_description[data-aa-quill-editor]')
2024
expect(page).to have_css('#post_description_input .ql-editor', text: 'Some content...')
2125
find('#post_description_input .ql-editor').click
2226
find('#post_description_input .ql-editor').base.send_keys('more text')

0 commit comments

Comments
 (0)