Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly verify that cache accepts and uses expires value. #24592

Merged
merged 1 commit into from
Apr 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion actionpack/test/controller/caching_test.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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>