Skip to content

Commit

Permalink
Properly verify that cache accepts and user expires value.
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulnsward committed Apr 17, 2016
1 parent 3b0a627 commit 3a24247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion actionpack/test/controller/caching_test.rb
Expand Up @@ -219,12 +219,15 @@ def test_skipping_fragment_cache_digesting
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
Expand Down
@@ -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>

0 comments on commit 3a24247

Please sign in to comment.