aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/form_tag_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Don't enforce UTF-8 by defaultAndrew White2018-02-271-0/+27
| | | | | | With the disabling of TLS 1.0 by most major websites, continuing to run IE8 or lower becomes increasingly difficult so default to not enforcing UTF-8 encoding as it's not relevant to other browsers.
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-2/+2
|
* Remove alt generation from image_submit_tagRafael Mendonça França2017-08-231-1/+1
|
* Fix RuboCop offensesKoichi ITO2017-08-161-8/+8
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Make sure Action View doesn't break with Active StorageRafael Mendonça França2017-08-031-0/+37
| | | | | When Active Storage is not loaded and direct_upload is used on file_field_tag we should not raise an exception.
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* 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.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-021-0/+1
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
| |
* | Merge pull request #29506 from pat/frozen-string-literalsMatthew Draper2017-07-021-2/+2
|\ \ | | | | | | | | | Make ActiveSupport frozen-string-literal friendly.
| * | Make ActionView frozen string literal friendly.Pat Allan2017-06-201-2/+2
| |/ | | | | | | Plus a couple of related ActionPack patches.
* / Fallback Parameters#to_s to Hash#to_sKir Shatrov2017-06-301-0/+6
|/ | | Fixes https://github.com/rails/rails/issues/29617
* Prevent duplicate data-disable-with attributesTyler Hunt2017-01-031-0/+7
| | | | | | When using the hash form of the data option, prevent duplicate data-disable-with attributes from appearing in the submit tag due to both string and symbol forms of the hash key being present.
* Fix Rubocop violations and fix documentation visibilityRafael Mendonça França2016-12-281-5/+5
| | | | | | Some methods were added to public API in 5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of the public API.
* assert_equal takes expectation firstAkira Matsuda2016-12-261-5/+5
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | 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
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-3/+3
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-15/+15
|
* modernizes hash syntax in actionviewXavier Noria2016-08-061-60/+60
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-18/+18
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Change datetime to datetime-local helper tagHerminio Torres2016-06-211-4/+2
| | | | | | | | | | | A change was made in the helper that renders the `datetime`, being now by default `datetime-local` and creating an alias of `datetime-local` for `datetime`, `datetime` tag and it passes to be an abstract class for all other tags that inherit from him. As a new specification of the HTML 5 the text field type `datetime` will no longer exist and will pass a `datetime-local`. Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
* Confirm with the specification when generating emtpy option for select with ↵Vipul A M2016-05-211-5/+5
| | | | | | | | | | | | `include_blank: true` option. We now generate option with empty label, example: `<select id="places" name="places"><option value="" label=" "></option></select>` for include_blank: true. This is only done, if content is missing on the option, and we providing the value from this option. Fixes #24816
* Deprecate `datetime_field` and `datetime_field_tag` helpers.Wojciech Wnętrzak2016-03-311-1/+3
| | | | | Datetime input type was removed from HTML specification. One can use `datetime_local_field` and `datetime_local_field_tag` instead.
* html_safe is not supposed to be public API for AV. This change removes usage ↵Vipul A M2016-01-201-12/+12
| | | | | | 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()
* fix TypeError when using submit_tag with Symbol valueyuuji.yaginuma2015-12-241-0/+7
|
* Add test cases for checkbox_tagPrakash Laxkar2015-10-011-0/+12
|
* Add test case for text_field_tagAkshay Vishnoi2015-10-011-1/+7
|
* Merge pull request #21661 from akshay-vishnoi/submit_tag_testsRafael Mendonça França2015-09-291-0/+8
|\ | | | | Fix - Prevent adding of `data-disable-with` option twice in html.
| * Fix - Prevent adding of `data-disable-with` option twice in html.Akshay Vishnoi2015-09-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier when `data-disable-with` option is added direclty as in options then ```ruby submit_tag("Save", { "data-disable-with" => "Processing..." }) # => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." data-disable-with="Processing..." /> ``` Now when `data-disable-with` option is added direclty as in options then ```ruby submit_tag("Save", { "data-disable-with" => "Processing..." }) # => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." /> ```
* | Fix names of test casesAkshay Vishnoi2015-09-291-3/+3
|/
* Make disable_with default in submit_tagJustin Schiff2015-08-111-1/+39
| | | | | | | | | | | | | | Prevents double submission by making disable_with the default. Default disable_with option will only be applied if user has not specified her/his own disable_with option, whether that is in the `data-disable-with` string form or the `:data => { :disable_with => "Saving..." }` hash form. disable_with will default to the value attribute. A configuration option was added to opt out of this functionality if the user so desires. `config.action_view.automatically_disable_submit_tag = false`
* Add missing spec and documentation for button_tag helperAkshay Vishnoi2015-05-241-0/+7
|
* [Fix Select tag Tests] Test correct use of multiple option for selectAkshay Vishnoi2015-03-201-4/+4
|
* Fix select_tag generating tag when set to false.Guo Xiang Tan2014-11-211-0/+6
| | | | Fixes https://github.com/rails/rails/issues/17701.
* Use new hash syntaxRafael Mendonça França2014-10-251-1/+1
|
* :scissors:Rafael Mendonça França2014-10-251-1/+1
|
* Merge pull request #17064 from frenkel/fix_select_tag_include_blankRafael Mendonça França2014-10-251-0/+6
|\ | | | | Use include_blank value as option label
| * Use include_blank value as option labelFrank Groeneveld2014-10-171-0/+6
| | | | | | | | Update select_tag to reflect documentation and behave the same as form builder select. If the value of include_blank is not boolean true, use that value as the option label.
* | Fix how file_ and password_field_tag edit optionsclaudiob2014-10-151-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the behavior of `file_field_tag` and `password_field_tag` when invoked with a hash of options. These two helpers are different from all the other ones in that they modify the options hash passed as a parameter, whereas all the other helpers duplicate it before updating it. The result is that *bad things* can happen if the user re-uses the same hash. For instance, users who write the following code to display a file field followed by a text field (both with the same class): ```rhtml <% options = {class: 'important'} %> <%= file_field_tag 'Upload', options %> <%= text_field_tag 'Name', options %> ``` would instead see **two file fields!** ```html <input class="important" id="Upload" name="Upload" type="file"> <input class="important" id="Name" name="Name" type="file" value="value"> ``` This PR replaces `update` with `merge` in the code of the two helpers, fixing the issue above. The included test verifies the change, since it passes after this PR, but fails before with the following error: ``` Expected: <input type="text" name="title" id="title" value="Hello!" class="important" /> Actual: <input type="password" name="title" id="title" value="Hello!" class="important" /> ```
* We don't need loofah for the assertionsRafael Mendonça França2014-07-151-1/+1
| | | | We can just use nokogiri
* Replaced html-scanner with Loofah.Timm2014-06-151-1/+1
|
* Remove wrapping div with inline styles for hidden form fields.Joost Baaij2014-04-141-5/+8
| | | | | | We are dropping HTML 4.01 and XHTML strict compliance since input tags directly inside a form are valid HTML5, and the absense of inline styles help in validating for Content Security Policy.
* fixes default attributes for button_tagSergey Prikhodko2014-03-031-0/+5
|
* Switched to use `display:none` in extra_tags_for_form method.Gaelian Ditchburn2014-01-051-1/+1
| | | | | | | | | | | | | The use of `display:inline` with the content_tag call in the extra_tags_for_form method potentially causes display issues with some browsers, namely Internet Explorer. IE's behaviour of not collapsing the line height on divs with ostensibly no content means that the automatically added div containing the hidden authenticity_token, utf8 and _method form input tags may interfere with other visible form elements in certain circumstances. The use of `display:none` rather than `display:inline` fixes this problem. Fixes #6403
* Added an `enforce_utf8` hash option for `form_tag` methodTakayuki Matsubara2013-07-071-1/+16
| | | | | | | | | | | | | | | | | | Control to output a hidden input tag with name `utf8` without monkey patching Before: form_tag # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>' After: form_tag # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>' form_tag({}, { :enforce_utf8 => false }) # => '<form>....</form>'
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+614