aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/form_options_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix integer regex deprecation warnings for Ruby 2.6.0 (#34728)Vinicius Stock2018-12-211-0/+1
| | | | | * Fix integer regex deprecation warnings for Ruby 2.6.0 * Define =~ in FakeZone to avoid warnings from Ruby 2.6.0
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|
* Merge pull request #33547 from Ana06/patch-1Matthew Draper2018-08-231-1/+14
|\ | | | | | | Use public_send in value_for_collection
| * Add tests for privates methods in view's helpersAna María Martínez Gómez2018-08-081-1/+14
|/ | | | | | | | Test that using private methods in `options_from_collection_for_select` is deprecated. Make the unused `secret` paramether in the `Post` Struct private to use it in the test.
* Let select render default selected option for required fieldSerj Prikhodko2018-02-271-0/+10
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-3/+3
|
* Merge pull request #31578 from ↵George Claghorn2017-12-291-0/+16
|\ | | | | | | | | Aquaj/feature/allow-callables-in-select-group-methods Allow the use of callable objects as group methods for grouped selects.
| * Allow the use of callable objects as group methods for grouped selects.Jérémie Bonal2017-12-271-0/+16
| | | | | | | | | | | | Replaced the uses of `group.send(...)` in `option_groups_from_collection_for_select` by calls to `value_for_collection(group, ...)`, allowing the use of procs, lambdas and other callable objects as parameters.
* | Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-121-1/+1
|/ | | | Follow up of #31390.
* Fix field_error_proc wrap form select optgroup and divider option tagneumayr2017-11-091-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | ### 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`
* Fix RuboCop offensesKoichi ITO2017-08-161-24/+24
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* Enable `Layout/FirstParameterIndentation` copRyuta Kamizono2017-07-171-22/+22
| | | | | | | We have some indentation cops. But now there is a little inconsistent params indentations. Enable `Layout/FirstParameterIndentation` cop to prevent newly inconsistent indentation added and auto-correct to existing violations.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Fix select tag helper used with Enumerable choicesSam Pohlenz2017-05-171-0/+17
| | | | | | Allows a custom object implementing Enumerable to be used as the choices parameter for a select tag, which previously wasn't possible due to the call to `empty?` on the choices (which isn't implemented on Enumerable).
* Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-121-118/+118
| | | | (I personally prefer writing one string in one line no matter how long it is, though)
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-35/+35
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-7/+7
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-061-6/+6
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-40/+40
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-4/+4
|
* modernizes hash syntax in actionviewXavier Noria2016-08-061-69/+69
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-61/+61
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* - Added select tag test for verifying passing html options to f.select helperVipul A M2016-06-281-1/+10
| | | | - Renamed test to be more descriptive
* Support for unified Integer class in Ruby 2.4+Jeremy Daer2016-05-181-1/+1
| | | | | | | | Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005 * Forward compat with new unified Integer class in Ruby 2.4+. * Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3. * Drops needless Fixnum distinction in docs, preferring Integer.
* html_safe is not supposed to be public API for AV. This change removes usage ↵Vipul A M2016-01-201-1/+1
| | | | | | of html_safe in favour of raw() in AV helpers. Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw()
* Bring back `===` stubbing in `time_zone_select` test.Kasper Timm Hansen2015-11-221-1/+7
| | | | | | | Erroneously removed in 58910dc7. The stubbing was a regression test to ensure `time_zone_select` wasn't implemented with `grep`. Rename the test and add a comment to make the intent clearer.
* Ditch `each_with_index` for `each`.Kasper Timm Hansen2015-11-221-1/+1
| | | | We never touch the index, so don't bother.
* Don't cache fake time zones.Kasper Timm Hansen2015-11-221-8/+9
| | | | | | | | | When calling `test_time_zone_select_with_priority_zones_as_regexp` it would define `=~` on the fake zones, but it would never be cleaned up because of the zone cache. Nuke it so `test_time_zone_select_with_priority_zones_as_regexp_using_grep_finds_no_zones` accidentally find any zones because of `=~` being implemented.
* Removed Mocha from Action ViewRonak Jangir2015-09-231-13/+31
|
* Raise an ArgumentError when `include_blank` is false for a required field inGrey Baker2015-06-081-0/+7
| | | | | | | | | | `Tags::Base#select_content_tag`. Previously, passing a falsey value to `include_blank` would be ignored if the field was required, and a blank line would still be inserted. The following will now raise instead of quietly failing: `select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
* Fixed #select form builder helper to support block with html outputBogdan Gusiev2014-08-051-0/+13
|
* Add test for selected and disabled custom attributes in options_for_selectLaura Paredes2014-03-311-1/+21
|
* Fix some edge cases for AV `select` helper with `:selected` optionBogdan Gusiev2013-09-231-0/+16
|
* Ability to pass block to AV#select helperBogdan Gusiev2013-09-231-0/+15
| | | | | | | | Example: = select(report, "campaign_ids") do - available_campaigns.each do |c| %option{:data => {:tags => c.tags.to_json}, :value => c.id}= c.name
* There's no need to do thisSantiago Pastorino2013-09-171-4/+1
| | | | | | | AS does the following inside Time.find_zone! ... `ActiveSupport::TimeZone[time_zone] || TZInfo::Timezone.get(time_zone)` and given that the test is stubbing AS::TZ[] we don't need the removed code.
* add support for html attributes to grouped_options_for_selectVasiliy Ermolovich2013-07-201-0/+10
|
* Remove passing the prompt to grouped_options_for_select as an argument, ↵kennyj2013-06-281-17/+0
| | | | because it was deprecated.
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+1304