From 29e5c2057808c3c32ddf0d2b3d99224037d15a62 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Fri, 12 Feb 2016 22:15:15 +0100 Subject: [PATCH] Check `partial_rendered_times` to clarify expectations. It was difficult to see when the partials were rendered, and how many times we expected it to be rendered before. Because we weren't explaining it. --- actionpack/test/controller/caching_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index a1785d9ab1..2de716aa00 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -417,8 +417,11 @@ class AutomaticCollectionCacheTest < ActionController::TestCase def test_preserves_order_when_reading_from_cache_plus_rendering get :index, params: { id: 2 } - get :index_ordered + assert_equal 1, @controller.partial_rendered_times + assert_select ':root', 'david, 2' + get :index_ordered + assert_equal 3, @controller.partial_rendered_times assert_select ':root', "david, 1\n david, 2\n david, 3" end