1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test/template
neumayr ead4776b82 Fix field_error_proc wrap form select optgroup and divider option tag
### Summary

The [`:field_error_proc`](https://github.com/rails/rails/blob/master/actionview/lib/action_view/base.rb#L145) is responsible for decorating input tags that refer to attributes with errors. This default build-in rails feature wrap invalid form elements with additional markup: `<div class="field_with_errors">[…]</div>`.

* Fix for `field_error_proc` wraps form select `optgroup`
* Fix for `field_error_proc` wraps form select divider `option`
* Add tests for uncovered elements with errors

[Fixes #31088]

#### Test coverage
* `test_select_grouped_options_with_errors`
* `test_time_zone_select_with_priority_zones_and_errors`

#### Extend test coverage
* `test_collection_select_with_errors`
* `test_label_with_errors`
* `test_check_box_with_errors`
* `test_check_boxes_with_errors`
* `test_radio_button_with_errors`
* `test_radio_buttons_with_errors`
* `test_collection_check_boxes_with_errors`
* `test_collection_radio_buttons_with_errors`
2017-11-09 17:37:06 +01:00
..
erb Remove deprecated Erubis ERB handler 2017-10-23 12:50:31 -04:00
form_helper Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
testing Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
active_model_helper_test.rb Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
asset_tag_helper_test.rb Implement H2 Early Hints for Rails 2017-10-04 09:17:21 -04:00
atom_feed_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
capture_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
compiled_templates_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
controller_helper_test.rb Merge pull request #29897 from kirs/frozen-actionview 2017-07-24 15:54:08 -04:00
date_helper_i18n_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
date_helper_test.rb Fix RuboCop offenses 2017-08-16 17:55:25 +09:00
dependency_tracker_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
digestor_test.rb Remove unused FixtureTemplate class 2017-10-19 08:29:48 +09:00
erb_util_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
form_collections_helper_test.rb Fix RuboCop offenses 2017-08-16 17:55:25 +09:00
form_helper_test.rb Fix RuboCop offenses 2017-08-16 17:55:25 +09:00
form_options_helper_i18n_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
form_options_helper_test.rb Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
form_tag_helper_test.rb Remove alt generation from image_submit_tag 2017-08-23 11:57:23 -04:00
html_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
javascript_helper_test.rb Implement H2 Early Hints for Rails 2017-10-04 09:17:21 -04:00
log_subscriber_test.rb Fix "warning: instance variable @defined_root not initialized" 2017-11-02 10:08:21 +09:00
lookup_context_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
number_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
output_safety_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
partial_iteration_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
record_identifier_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
record_tag_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
render_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
resolver_cache_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
resolver_patterns_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
sanitize_helper_test.rb Fix test_should_sanitize_illegal_style_properties failure 2017-09-25 07:15:52 +09:00
streaming_render_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
tag_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
template_error_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
template_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
test_case_test.rb Fix testing helpers that use Action View's capturing helpers (e.g. content_for) 2017-07-25 22:27:11 -04:00
test_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
text_helper_test.rb Fix RuboCop offenses 2017-08-16 17:55:25 +09:00
text_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
translation_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
url_helper_test.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00