aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/render_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #18948 from kaspth/automatic-collection-cachingRafael Mendonça França2015-02-251-0/+38
|\ | | | | Merge multi_fetch_fragments.
| * Collections automatically cache and fetch partials.Kasper Timm Hansen2015-02-211-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collections can take advantage of `multi_read` if they render one template and their partials begin with a cache call. The cache call must correspond to either what the collections elements are rendered as, or match the inferred name of the partial. So with a notifications/_notification.html.erb template like: ```ruby <% cache notification %> <%# ... %> <% end %> ``` A collection would be able to use `multi_read` if rendered like: ```ruby <%= render @notifications %> <%= render partial: 'notifications/notification', collection: @notifications, as: :notification %> ```
| * Merge multi_fetch_fragments.Kasper Timm Hansen2015-02-201-0/+14
| | | | | | | | | | | | | | | | Makes caching a collection of template partials faster using `read_multi` on the Rails cache store. Some caching implementations have optimized `read_multi` so we don't have to check in the cache store for every template.
* | Error message testing fixFranky W2015-02-201-1/+2
|/ | | | | | | | | The testing of error messages have been implemented wrongly a few times. This is an attempt to fix it. For example, some of these test should have failed with the new code. The reason they are not failling with the new string is the fact they were not being tested beforehand.
* Partial template name does no more have to be a valid Ruby identifierAkira Matsuda2015-02-061-13/+8
| | | | because the partial renderer would not create an lvar per each template since c67005f221f102fe2caca231027d9b11cf630484
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Merge pull request #17974 from killthekitten/fix-render-blockRafael Mendonça França2015-01-021-0/+5
|\ | | | | | | | | | | | | Make possible to use blocks with short version of render partial Conflicts: actionview/CHANGELOG.md
| * Make possible to use blocks with short version of render partialNikolay Shebanov2014-12-191-0/+5
| |
* | fix error message of option as with invalid charters in partial renderingAngelo capilleri2014-12-291-3/+17
|/ | | | | before this PR IDENTIFIER_ERROR_MESSAGE could lead to misunderstand the convention of partial name. Added OPTION_AS_ERROR_MESSAGE for unvalid charter in as option.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* adding missing test coverageEugene Gilburg2014-07-181-0/+12
|
* Added PartialIteration class used when rendering collectionsJoel Junström2014-07-161-1/+1
| | | | | | | | | | | | The iteration object is available as the local variable "template_name_iteration" when rendering partials with collections. It gives access to the +size+ of the collection beeing iterated over, the current +index+ and two convinicence methods +first?+ and +last?+ "template_name_counter" variable is kept but is deprecated. [Joel Junström + Lucas Uyezu]
* Assert the nature of the original exceptionMatthew Draper2014-07-121-0/+1
| | | | | | Just so it's clearer what's going on in the following assertion. /cc #11993 @robin850
* Merge pull request #11993 from razielgn/actionview-use-name-to-inspect-errorGuillermo Iguaran2014-07-111-1/+1
|\ | | | | Use NameError#name to assert raised error.
| * Use NameError#name to assert raised error.Federico Ravasio2013-11-241-1/+1
| | | | | | | | | | This makes the test compatible with other Ruby implementations, which may implement error messages differently.
* | Clean up I18n stored translations after test.Zuhao Wan2014-06-141-1/+2
| |
* | Add unregister_template_handler to prevent leaks.Zuhao Wan2014-06-121-4/+23
| |
* | Fix a fragile test on `action_view/render`Prem Sichanugrist2014-02-181-1/+1
| | | | | | | | | | | | This test were assuming that the list of render options will always be the same. Fixing that so this doesn't break when we add/remove render option in the future.
* | Added tests to render helper that expect `render partial: @foo` toIain Beeston2014-02-121-0/+10
| | | | | | | | | | | | | | | | | | | | automatically call @foo.to_partial_path Calling `render @foo` allows local variables but not options to be passed to the partial renderer. The correct way to render an object AND pass options to the partial renderer is to pass the object in the `:partial` parameter. However, there were previously no tests for this behaviour (in `render_helper_test.rb` at least).
* | `ActionView::MissingTemplate` for partials includes underscore.Yves Senn2013-12-021-2/+2
|/ | | | | | Missing partial folder/_partial instead of folder/partial. Closes #13002.
* Warnings removed for ruby trunkArun Agrawal2013-11-011-1/+1
| | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* Fix default rendered format problem when calling render method without ↵kennyj2013-07-151-0/+5
| | | | :content_type option. Closes #11393.
* Check if malformed fixture exists firstŁukasz Strzałkowski2013-06-201-0/+1
| | | | Now if somebody by mistake will remove malformed files test will raise error.
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+537