From 43a7adb0afd52a83b1d2850c43d007f9a4526034 Mon Sep 17 00:00:00 2001 From: Alberto Almagro Date: Wed, 10 Oct 2018 22:03:54 +0200 Subject: Add test coverage for form with rich-text-area --- test/template/form_helper_test.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/template/form_helper_test.rb b/test/template/form_helper_test.rb index d7bdbad26c..18b5edbee5 100644 --- a/test/template/form_helper_test.rb +++ b/test/template/form_helper_test.rb @@ -18,4 +18,32 @@ class ActionText::FormHelperTest < ActionView::TestCase assert_match "message[not_an_attribute]", output_buffer end + + test "form with rich_text_area" do + expected = '
'\ + ''\ + ''\ + ''\ + '
' + + form_with(model: Message.new, scope: :message, id: "create-message") do |form| + form.rich_text_area(:content) + end + + assert_dom_equal expected, output_buffer + end + + test "form with rich_text_area providing class option" do + expected = '
'\ + ''\ + ''\ + ''\ + '
' + + form_with(model: Message.new, scope: :message, id: "create-message") do |form| + form.rich_text_area(:content, class: "custom-class") + end + + assert_dom_equal expected, output_buffer + end end -- cgit v1.2.3