diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2016-04-17 13:05:10 -0500 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2016-04-17 13:05:10 -0500 |
commit | 7365c976a011c6806906cefc70bd4a2c027d0175 (patch) | |
tree | 152d2a52ebd5a2a33e8a4e29a0927bc6da963393 /actionpack | |
parent | 1386d14112879c0ffeb77de71c7cf0be02b454fa (diff) | |
parent | 3a24247b95e21e093ab706e394de392220cc4929 (diff) | |
download | rails-7365c976a011c6806906cefc70bd4a2c027d0175.tar.gz rails-7365c976a011c6806906cefc70bd4a2c027d0175.tar.bz2 rails-7365c976a011c6806906cefc70bd4a2c027d0175.zip |
Merge pull request #24592 from vipulnsward/properly-verify-expires
Properly verify that cache accepts and uses `expires` value.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 5 | ||||
-rw-r--r-- | actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 754ac144cc..7faf3cd8c6 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -219,12 +219,15 @@ CACHED end def test_fragment_caching_with_options + time = Time.now get :fragment_cached_with_options assert_response :success expected_body = "<body>\n<p>ERB</p>\n</body>\n" assert_equal expected_body, @response.body - assert_equal "<p>ERB</p>", @store.read("views/with_options") + Time.stub(:now, time + 11) do + assert_nil @store.read("views/with_options") + end end def test_render_inline_before_fragment_caching diff --git a/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb b/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb index 01453323ef..951c761995 100644 --- a/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb +++ b/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb @@ -1,3 +1,3 @@ <body> -<%= cache 'with_options', skip_digest: true, expires_in: 1.minute do %><p>ERB</p><% end %> +<%= cache 'with_options', skip_digest: true, expires_in: 10 do %><p>ERB</p><% end %> </body> |