require 'test_helper' class TrixEditorTest < ActionView::TestCase tests ActionView::Helpers test "#text_editor_tag returns proper trix tag" do post = Post.new form = form_for post do |f| f.trix_editor :body end assert_equal '
', form end test "#text_editor_tag properly handles values" do post = Post.new(body: "my value") form = form_for post do |f| f.trix_editor :body end assert_equal '', form end test "#text_editor_tag takes placeholder attribute" do post = Post.new form = form_for post do |f| f.trix_editor :body, placeholder: 'my placeholder' end assert_equal '', form end test "#text_editor_tag takes input attribute" do post = Post.new form = form_for post do |f| f.trix_editor :body, input: 'my-input' end assert_equal '', form end test "can instantiate new trix editor helper" do post = Post.new form = form_for post do |f| f.trix_editor :body f.trix_editor :summary end assert_equal '', form end end