aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/digestor_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-1/+1
|
* modernizes hash syntax in actionviewXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-7/+7
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Add test for nested html dependencies with same logical name as templates ↵Javan Makhmali2016-06-151-2/+6
| | | | for other formats
* Move and rename testJavan Makhmali2016-06-151-7/+7
|
* Fix finding templates for digesting for */* requests that render a ↵Javan Makhmali2016-06-151-0/+22
| | | | non-default (html) template
* Explicity find with the rendered format to handle searching multiple view ↵Javan Makhmali2016-06-151-1/+1
| | | | paths correctly
* Fix digesting templates with identical logical names when requesting a ↵Javan Makhmali2016-06-151-1/+11
| | | | format other than the first default
* Extract resolver cache disabling to a method.Kasper Timm Hansen2016-05-091-22/+23
| | | | Will be using this in later code.
* No need to call `remove_template`.Kasper Timm Hansen2016-05-091-1/+0
| | | | | Each test executes in another tmp folder, so there's no chance of polluting another test run.
* Merge branch 'master' into treewipAaron Patterson2016-02-241-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (113 commits) remove useless method Updated file documentation [ci skip] changes caching guide to add note on weak etags Don't put config.action_mailer.perform_caching entry twice in development.rb Fix wording and wrong reference Add Ruby formatting to CHANGELOG entry Fix ActionView's cache section reference Do not define methods in the included block Add caching guide in ActionMailer basics Add ActionMailer configuration options Preparing for 5.0.0.beta3 release Update 5.0 release notes Enable tmp_restart plugin for puma Prep release for Rails 5 beta3 [ci skip] Move collection caching changelog entry. Ensure `drop_table` even if tests failure or interrupted :bomb: run the test @rafaelfranca :angry: Remove changelog entry for reverted commit Add CHANGELOG for https://github.com/rails/rails/pull/23734 [ci skip] No need CHANGELOG entry for #23849. ...
| * clear digest cache between testsAaron Patterson2016-02-231-0/+1
| | | | | | | | | | otherwise we don't get the log messages we're looking for and the tests fail intermittently.
* | push injected dependencies up to the `digest` methodAaron Patterson2016-02-181-2/+2
| | | | | | | | | | | | Only the root node has injected dependencies, so we don't need to care about them at lower levels. This change pushes the injected dependencies up to where the user passed them in.
* | use the class level digest method for calculating the digestAaron Patterson2016-02-181-3/+1
| |
* | cache all subnodes in the digest cacheAaron Patterson2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | this is for backwards compatibility. We should remove this after 5-0-stable is created because digest calculation should be amortized. Caching digests of subtrees will speed up digests for other trees that share the same children. However, this will also increase memory, and after the app warms up, then those subtrees will never be reused which means that memory is wasted.
* | Merge branch 'master' into treewipAaron Patterson2016-02-181-3/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (27 commits) move digest cache on to the DetailsKey object remove object `hash` cache [ci skip] fix suggested change-replace 'an' with 'the in Rails engine guide' Missing documentation about hash algorithm option for MessageVerifier [ci skip] set `skip_listen` option to dummy appplication Fix the language in engines guide Add accidentally removed `#` [ci skip] fields_for_style needs to test for AC::Parameters Fix indentation for code block in changelog Remove accidentally duplicated change log title [ci skip] partially revert 69009f4473637a44ade26d954ef5ddea6ff903f2 Remove needless `case_insensitive_comparison` in mysql2 adapter modify to `error` also abort when specify fail fast option Implement ActionController::Parameters#inspect remove unused method Remove unused Journey code Add Action Cable CHANGELOG in release notes [ci skip] Show proper error message when a non-relation object is passed to AR::Relation#or Fix semantics of test names for finish option in batches_test Fix typo ... Conflicts: actionview/lib/action_view/digestor.rb
| * move digest cache on to the DetailsKey objectAaron Patterson2016-02-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This moves digest calculation cache on to the details key object. Before, the digest cache was a class level ivar, and one of the keys was the hash value of the details key object: https://github.com/rails/rails/blob/13c4cc3b5aea02716b7459c0da641438077f5236/actionview/lib/action_view/digestor.rb#L28 An object's hash value is not unique, so it's possible for this cache key to produce colliding keys with no resolution. This commit move cache on to the details key object itself, so we know that the digests are always unique per details key object.
| * adds tests for Digestor#nested_dependenciesRyan T. Hosford2016-02-131-0/+10
| |
* | change internal implementation to use a treeAaron Patterson2016-02-161-13/+10
| |
* | fix recursive templatesAaron Patterson2016-02-161-2/+3
| |
* | pull template check up to match existing behaviorAaron Patterson2016-02-161-1/+4
| | | | | | | | also remove the EMPTY node since we won't need it
* | introduce a `tree` factory method for creating the dep treeAaron Patterson2016-02-161-0/+7
|/ | | | also add an EMPTY sentinel node
* push kwargs up to the user facing APIAaron Patterson2016-02-121-2/+2
| | | | | | | this lets us leverage Ruby's kwarg handling (exceptions for missing params, etc) ASAP which allows us to skip active support method calls and make sure the exception stack is closer to where the user called the methods.
* the lookup context looks in the cwd, so prefix isn't necessaryAaron Patterson2016-02-121-2/+1
|
* use a real LookupContext in the digest testsAaron Patterson2016-02-121-28/+6
| | | | | This will ensure that the digestor stays in parity with the LookupContext object.
* use assert_not_equal so there will be better error messagesAaron Patterson2016-02-121-1/+1
| | | | in the case of failure it is nice to see what the two digests are.
* Add wildcard template dependencies.Kasper Timm Hansen2015-07-261-1/+36
|
* Remove unused persistent option.Kasper Timm Hansen2015-07-181-3/+3
|
* Make digest cache work in development.Kasper Timm Hansen2015-07-181-10/+0
| | | | | | Avoid computing the same fragment digest many times when looping over templates. The cache is cleared on every request so template changes are still picked up.
* add error log that notify 'file not found' when using ↵Faruk AYDIN2015-05-071-0/+20
| | | | cache_digests:dependency and cache_digests:nested_dependency tasks
* Make sure restoration always happen.Zuhao Wan2014-06-141-0/+1
|
* Digestor should just rely on the finder to know about the format and the ↵David Heinemeier Hansson2014-03-211-10/+7
| | | | variant -- trying to pass it back in makes a mess of things (oh, and doesnt work)
* Clarify AV::Digestor.digest method signature docs and deprecation warningJeremy Kemper2014-03-151-2/+2
|
* Fix the resolver cache and stop mutating the lookup_contextRafael Mendonça França2014-03-141-8/+0
| | | | | Before we had a bug in the resolver cache so the disable_cache were not working when passing options to find
* Introduce #with_formats_and_variants to prevent problems with mutating ↵Łukasz Strzałkowski2014-03-141-0/+8
| | | | finder object
* Add mocked disable_cache for FixtureFinderŁukasz Strzałkowski2014-03-141-0/+4
|
* Set format in finderŁukasz Strzałkowski2014-03-141-3/+8
|
* Ensure LookupContext in Digestor selects correct variantPiotr Chmolowski2014-03-091-3/+5
| | | | | | | | | | Related to: #14242 #14243 14293 Variants passed to LookupContext#find() seem to be ignored, so I've used the setter instead: `finder.variants = [ variant ]`. I've also added some more test cases for variants. Hopefully this time passing tests will mean it actually works.
* Variants in ActionView::DigestorPiotr Chmolowski2014-03-041-8/+27
| | | | | | | | | | | Take variants into account when calculating template digests in ActionView::Digest. Digestor#digest now takes a hash as an argument to support variants and allow more flexibility in the future. Old-style arguments have been deprecated. Fixes #14242
* Ensure the state is clean after one failureRafael Mendonça França2013-10-161-5/+4
|
* Add 2 tests, 1 of which fails, to isolate the digest_caching behaviour ↵Brad Murray2013-10-151-0/+26
| | | | | | | | | | causing #12521 If config.action_view.cache_template_loading = false, most likely in a development configuration if config.cache_classes = false & config.action_controller.perform_caching = true. config.action_view.cache_template_loading defaults to the value of config.cache_classes
* Bust the template digest cache key when details are changedDaniel Schierbeck2013-09-191-1/+29
| | | | | | Since the lookup details will influence which template is resolved, they need to be included in the cache key -- otherwise two different templates may erroneously share the same digest value.
* Only cache template digests if config.cache_template_loadingJosh Lauer2013-08-061-2/+11
| | | | | | since ActionView::Resolver.caching is set to the same value as config.cache_template_loading only cache template digests if config.cache_template_loading is not falsy fixes issues #10752 and #10791
* Fix test name typosVipul A M2013-07-191-2/+2
|
* Fix "Stack Level Too Deep" error when rendering recursive partialsRafael Mendonça França2013-07-071-0/+25
| | | | | | | When rendering recursive partial Action View is trying to generate the view digest infinitly causing a stack level error. Fixes #11340
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+197