aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/template_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate Template#refreshJohn Hawthorn2019-04-041-17/+3
|
* Don't discard source after renderingJohn Hawthorn2019-04-041-2/+2
| | | | | | | | | | Previously, we would discard the template source after rendering, if we had a virtual path, in hopes that the virtual path would let us find our same template again going through the Resolver. Previously we discarded the source as an optimization, to avoid keeping it around in memory. By instead just reading the file every time source is called, as FileTemplate does, this is unnecessary.
* Expand key word args for ActionView::TemplateAaron Patterson2019-02-251-1/+1
|
* Pass locals in to the template object on constructionAaron Patterson2019-02-251-8/+6
| | | | | | | This commit ensures that locals are passed in to the template objects when they are constructed, then removes the `locals=` mutator on the template object. This means we don't need to mutate Template objects with locals in the `decorate` method.
* Improve Template#inspect output (#35407)John Hawthorn2019-02-251-0/+10
| | | | | | | | | | | | | * Don't call inspect from identifier_method_name * Add locals Template#inspect Handler, formats, and variant are usually obvious from looking at the identifier. However it's not uncommon to have different locals for the same template so we should make that obvious in inspect. * Add tests for short_identifier and inspect [John Hawthorn + Rafael Mendonça França]
* Always pass a format to the ActionView::Template constructorAaron Patterson2019-02-251-2/+4
| | | | | This means we can eliminate nil checks and remove some mutations from the `decorate` method.
* Fix deprecation warnings and call superAaron Patterson2019-02-061-2/+2
|
* Move templates to an anonymous subclass of AV::BaseAaron Patterson2019-02-061-1/+3
| | | | | Now we can throw away the subclass and the generated methods will get GC'd too
* Always evaluate views against an ActionView::BaseAaron Patterson2019-01-161-1/+1
| | | | | Methods created by views should always be evaluated against an AV::Base instance. This way we can extract and refactor things in to classes.
* make actionview templates marshalable so that they can be serialized during ↵lsylvester2018-09-301-0/+7
| | | | the parallel tests (#34030)
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+1
|
* [Action View] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* 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
| |
* | Make ActionView frozen string literal friendly.Pat Allan2017-06-201-1/+1
|/ | | | Plus a couple of related ActionPack patches.
* fix RuboCop errors re \xFCXavier Noria2016-09-021-2/+4
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-12/+12
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Make collection caching explicit.Kasper Timm Hansen2016-02-201-32/+0
| | | | | | | | | | | | Having collection caching that wraps templates and automatically tries to infer if they are cachable proved to be too much of a hassle. We'd rather have it be something you explicitly turn on. This removes much of the code and docs to explain the previous automatic behavior. This change also removes scoped cache keys and passing cache_options.
* Removed Mocha from ActionView part 1Ronak Jangir2015-08-241-4/+6
|
* Support explicit defintion of resouce name for collection caching.Dov Murik2015-07-071-3/+5
| | | | | | | | | | | | | | If a template includes `# Template Collection: ...` anywhere in its source, that name will be used as the cache name for the partial that is rendered for the collection. This allows users to enable collection caching even if the template doesn't start with `<% cache ... do %>`. Moreover, the `# Template Collection: ...` notation is recognized in all template types (and template types other than ERB can define a resource_cache_call_pattern method to allow the `cache ... do` pattern to be recognized too).
* Improve detection of partial templates eligible for collection caching.Dov Murik2015-06-221-0/+30
| | | | | | | | | | | | | | The regular expression which was used to detect partial templates that begin with a `<% cache ... do %>` call missed some cases. This commits attempts to improve the detection for some cases such as multi-line comments at the beginning of the template. The different templates are listed in two new unit test methods. Note that specially crafted Ruby code can still evade such `cache`-call detection: for example, a user might have its own method which itself calls the Rails `cache` helper. In such a case, the template's code doesn't start with a literal `cache` string and therefore will not be eligible for collection caching.
* 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.
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+200