diff options
author | Aaron Patterson <tenderlove@github.com> | 2019-02-13 11:21:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 11:21:57 -0800 |
commit | af6ade0cfd09e3d3d9ebd304a2afae4d60a044dc (patch) | |
tree | 38fc87664f5bfcabfb9cac7cf9f57e0c083228bd /actionview/test | |
parent | b4dd69e59b3cb5c34bd58339d5b9a749e2cd82f3 (diff) | |
parent | bfcdd46614407d6bf1c955aad6ed4aa3094d2189 (diff) | |
download | rails-af6ade0cfd09e3d3d9ebd304a2afae4d60a044dc.tar.gz rails-af6ade0cfd09e3d3d9ebd304a2afae4d60a044dc.tar.bz2 rails-af6ade0cfd09e3d3d9ebd304a2afae4d60a044dc.zip |
Merge pull request #35253 from rails/cached-collections-must-have-a-template
Cached collections only work if there is one template
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/render_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 88047fd920..cda8c942d8 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -770,6 +770,17 @@ class CachedCollectionViewRenderTest < ActiveSupport::TestCase @view.render(partial: "test/cached_customer", collection: [customer], cached: true) end + test "collection caching does not work on multi-partials" do + a = Object.new + b = Object.new + def a.to_partial_path; "test/partial_iteration_1"; end + def b.to_partial_path; "test/partial_iteration_2"; end + + assert_raises(NotImplementedError) do + @controller_view.render(partial: [a, b], cached: true) + end + end + private def cache_key(*names, virtual_path) digest = ActionView::Digestor.digest name: virtual_path, finder: @view.lookup_context, dependencies: [] |