require 'test_helper' class RadioTest < ActiveSupport::TestCase def assigns {person: ::Person.new} end def helpers mock_action_view do def people_path '/people' end def employees_path '/employees' end end end test "radio requires a parent component" do assert_match "Error rendering ExpressTemplates::Components::Forms::Radio", arbre { radio :preferred_email_format, options: ['HTML', 'Text'] } end def radio_with_array_options html = arbre { express_form(:person) { radio :preferred_email_format, options: ['HTML', 'Text'] } } end test "radio has correct label field name and text" do assert_match /