diff --git a/test/action_view/cases/test_form_for_helpers.rb b/test/action_view/cases/test_form_for_helpers.rb index 7aa23e9b5..ae76d9105 100644 --- a/test/action_view/cases/test_form_for_helpers.rb +++ b/test/action_view/cases/test_form_for_helpers.rb @@ -433,48 +433,39 @@ def test_time_zone_select_with_validate_options end def test_date_select - input_html = '' - form_for(@post, validate: true) do |f| - input_html = f.date_select(:cost) - concat input_html + concat f.date_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_for('/posts', 'new_post', 'new_post', validators: validators) do - input_html + date_select :post, :cost end assert_dom_equal expected, output_buffer end def test_time_select - input_html = '' - form_for(@post, validate: true) do |f| - input_html = f.time_select(:cost) - concat input_html + concat f.time_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_for('/posts', 'new_post', 'new_post', validators: validators) do - input_html + time_select :post, :cost end assert_dom_equal expected, output_buffer end def test_datetime_select - input_html = '' - form_for(@post, validate: true) do |f| - input_html = f.datetime_select(:cost) - concat input_html + concat f.datetime_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_for('/posts', 'new_post', 'new_post', validators: validators) do - input_html + datetime_select :post, :cost end assert_dom_equal expected, output_buffer diff --git a/test/action_view/cases/test_form_with_helpers.rb b/test/action_view/cases/test_form_with_helpers.rb index f50824393..edafdc62f 100644 --- a/test/action_view/cases/test_form_with_helpers.rb +++ b/test/action_view/cases/test_form_with_helpers.rb @@ -463,48 +463,39 @@ def test_form_with_time_zone_select_with_validate_options end def test_date_select - input_html = '' - form_with(model: @post, validate: true) do |f| - input_html = f.date_select(:cost) - concat input_html + concat f.date_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_with('/posts', validators: validators) do - input_html + date_select :post, :cost end assert_dom_equal expected, output_buffer end def test_time_select - input_html = '' - form_with(model: @post, validate: true) do |f| - input_html = f.time_select(:cost) - concat input_html + concat f.time_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_with('/posts', validators: validators) do - input_html + time_select :post, :cost end assert_dom_equal expected, output_buffer end def test_datetime_select - input_html = '' - form_with(model: @post, validate: true) do |f| - input_html = f.datetime_select(:cost) - concat input_html + concat f.datetime_select(:cost) end validators = { 'post[cost]' => { presence: [{ message: "can't be blank" }] } } expected = whole_form_with('/posts', validators: validators) do - input_html + datetime_select :post, :cost end assert_dom_equal expected, output_buffer