Testing Rich Text Area Input Generation in Simple Form
This test suite validates the functionality of rich text area inputs in Simple Form, focusing on text attribute handling and placeholder support. The tests ensure proper HTML textarea generation and attribute assignment for form inputs.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
heartcombo/simple_form
test/inputs/rich_text_area_input_test.rb
# frozen_string_literal: true
# encoding: UTF-8
require 'test_helper'
class RichTextAreaInputTest < ActionView::TestCase
test 'input generates a text area for text attributes' do
with_input_for @user, :description, :text
assert_select 'textarea.text#user_description'
end
test 'input generates a text area for text attributes that accept placeholder' do
with_input_for @user, :description, :text, placeholder: 'Put in some text'
assert_select 'textarea.text[placeholder="Put in some text"]'
end
end