aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/asset_tag_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Implement H2 Early Hints for Railseileencodes2017-10-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When puma/puma#1403 is merged Puma will support the Early Hints status code for sending assets before a request has finished. While the Early Hints spec is still in draft, this PR prepares Rails to allowing this status code. If the proxy server supports Early Hints, it will send H2 pushes to the client. This PR adds a method for setting Early Hints Link headers via Rails, and also automatically sends Early Hints if supported from the `stylesheet_link_tag` and the `javascript_include_tag`. Once puma supports Early Hints the `--early-hints` argument can be passed to the server to enable this or set in the puma config with `early_hints(true)`. Note that for Early Hints to work in the browser the requirements are 1) a proxy that can handle H2, and 2) HTTPS. To start the server with Early Hints enabled pass `--early-hints` to `rails s`. This has been verified to work with h2o, Puma, and Rails with Chrome. The commit adds a new option to the rails server to enable early hints for Puma. Early Hints spec: https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04 [Eileen M. Uchitelle, Aaron Patterson]
* Add test case for `font_url`yuuji.yaginuma2017-10-031-0/+26
| | | | Since test of `font_url` was not in Action View's test suite, so it added.
* Make sure image_alt is deprecatedRafael Mendonça França2017-08-231-5/+15
|
* Do not generate default alt text in image tagsCameron Cundiff2017-08-171-16/+16
| | | | | | | | | | | | | | | | | | | | | - Auto-generating content from the filename of an image is not suitable alternative text; alt text that isn't fully considered can be distracting and fatiguing for screen readers users (blind, low vision, dyslexic people). - Setting a filename fallback short circuits screen reader default behavior and configuration for blank descriptions. - Setting poor defaults also creates false negatives for accessibility linting and testing software, that makes it harder to improve application accessibility. *** - After this change, if authors leave images without alt text, screen readers will fallback to default behavior for missing alt text. - Also with this change, Automated linting and testing tools will correctly generate warnings. [Fixes #30096]
* Extend image_tag to accept ActiveStorage Attachments and Variants (#30084)Anton Khamets2017-08-071-3/+0
| | | | | | | | | | | | | | | | | | * Extend image_tag to accept ActiveStorage's Attachments and Variants * Flip resolve_image_source around * Add tests for the new use-cases of image_tag * Remove the higher-level test * Update image_tag documentation * Add error states into the test suite * Re-raise polymorhic_url's NoMethodError as ArgumentError * delegate_missing_to will raise DelegationError instead of NoMethodError
* 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
| |
* | Add `srcset` option to `image_tag` helperRoberto Miranda2017-06-291-1/+4
|/
* Add :json type to auto_discovery_link_tagMike Gunderloy2017-05-201-0/+1
| | | | | This allows auto_discovery_link_tag to support the JSON Feed standard. See https://jsonfeed.org/version/1 for more information.
* Should escape meta characters in regexpRyuta Kamizono2017-05-071-3/+3
|
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-251-1/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-5/+5
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in actionviewXavier Noria2016-08-061-17/+17
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-48/+48
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Bring Boolean Attributes list for AV Tags helper upto speed with current spec.Vipul A M2016-06-281-2/+2
| | | | | | | | | This is based on https://github.com/kangax/html-minifier/blob/6b2d4536d82819143b468b41a89c700b6c61631f/src/htmlminifier.js#L197 and spec from https://www.w3.org/TR/html51/single-page.html. Couple of other changes to tests due to support update: - autobuffer has been dropped in favour of preload attribute, ref: https://msdn.microsoft.com/en-us/library/ff974743(v=vs.85).aspx - pubdate attribute has been dropped from spec, ref: https://www.w3.org/html/wg/tracker/issues/185
* Add tests to #23288Rafael Mendonça França2016-01-271-0/+1
|
* Add missing test cases for asset_pathAkshay Vishnoi2015-12-171-0/+2
|
* Example of setting data attributes for image_tagNishant Modak2015-11-201-1/+2
|
* Allow `host` option in javscript and css helpersGrzegorz Witek2015-11-081-0/+2
| | | | | Now both `javascript_include_tag` and `stylesheet_tag` can accept `host` option to provide custom host for the asset
* Removed Mocha from ActionView part 1Ronak Jangir2015-08-241-4/+6
|
* Merge pull request #20669 from akolomiychuk/image-pathYves Senn2015-06-291-0/+5
|\ | | | | | | Passing nil to image_tag
| * Add nil check in asset_pathAnton Kolomiychuk2015-06-291-0/+5
|/
* image_tag raises an error if size is passed with height and/or widthMike Stone2015-04-241-0/+8
|
* Zlib isn't required for AssetTagHelperTest anymoreThiago Pradi2015-03-141-1/+0
|
* Allow to pass a string value to size option in `image_tag` and `video_tag`Mehdi Lahmam2015-02-161-0/+2
| | | | This makes the behavior more consistent with `width` or `height` options
* remove un-needed sortschneems2014-10-071-1/+1
| | | | | | HTML doesn't care what order the elements are rendered in, so why should we? Updates tests to use proper `assert_dom_equal` instead of `assert_equal` /cc @jeremy
* Revert "Merge pull request #15312 from JuanitoFatas/action_view/asset_path"Matthew Draper2014-09-141-0/+11
| | | | | | | This reverts commit 21ec7fefea5a1b823cb88733b019b3d52240801d. Per #16911, there's actually a good reason for a "blank" value to have a useful `to_s` here. So let's also add some tests to prove that.
* Return an absolute instead of relative path from an asset url in the case of ↵Jolyon Pawlyn2014-07-151-0/+8
| | | | the `asset_host` proc returning nil
* Allow custom asset host to be passed in asset_urlHubert Łępicki2014-05-081-0/+15
|
* always use File.joinphoet2014-05-011-0/+8
|
* Change favicon_link_tag helper mimetype from image/vnd.microsoft.icon to ↵glorieux2014-04-211-3/+3
| | | | | | | | image/x-icon. Although the official IANA-registered MIME type for ICO files is image/vnd.microsoft.icon, registered in 2003, it was submitted to IANA by a third party and is not recognized by Microsoft products. The MIME type image/x-icon should be used since is the one recognized by the major browsers on the market.
* Unused classes in AV testsAkira Matsuda2013-12-241-8/+0
|
* allow video_tag to accept `size` as `Number` for square shaped videosKuldeep Aggarwal2013-12-181-1/+1
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+762