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
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
..
actionpack Merge pull request #31005 from shuheiktgw/remove_unnecessary_semicolons 2017-10-28 22:55:34 +10:30
activerecord Remove unused methods from RenderPartialWithRecordIdentificationController 2017-09-30 17:38:27 +09:00
fixtures Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
lib/controller Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
template Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
tmp Unify the internal source control .keep file name 2017-08-24 13:40:26 +09:00
ujs Enable to call Rails.ajax without beforeSend 2017-10-28 12:13:19 +09:00
abstract_unit.rb Include ActionDispatch::DrawOnce in ActiveSupport::TestCase 2017-09-27 08:51:37 +09:00
active_record_unit.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00