From d4a4a6f11814649bf3c628492ff7ac45a6d2b610 Mon Sep 17 00:00:00 2001 From: Yurii Cherniavskyi Date: Fri, 20 Jul 2018 23:21:02 +0300 Subject: Fix leaking special form_with attributes into html attributes Special form_with attributes `skip_default_ids` and `allow_method_names_outside_object` attributes are leaking into html attributes of option select tag helpers. --- actionview/test/template/form_helper/form_with_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/form_helper/form_with_test.rb b/actionview/test/template/form_helper/form_with_test.rb index ed1683bad2..f07e494ee3 100644 --- a/actionview/test/template/form_helper/form_with_test.rb +++ b/actionview/test/template/form_helper/form_with_test.rb @@ -464,6 +464,23 @@ class FormWithActsLikeFormForTest < FormWithTest end end + def test_form_with_with_collection_select + post = Post.new + def post.active; false; end + form_with(model: post) do |f| + concat f.collection_select(:active, [true, false], :to_s, :to_s) + end + + expected = whole_form("/posts") do + "" + end + + assert_dom_equal expected, output_buffer + end + def test_form_with_with_collection_radio_buttons post = Post.new def post.active; false; end -- cgit v1.2.3