1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test/activerecord/relation_cache_test.rb

25 lines
700 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "active_record_unit"
class RelationCacheTest < ActionView::TestCase
tests ActionView::Helpers::CacheHelper
def setup
super
view_paths = ActionController::Base.view_paths
lookup_context = ActionView::LookupContext.new(view_paths, {}, ["test"])
@view_renderer = ActionView::Renderer.new(lookup_context)
@virtual_path = "path"
controller.cache_store = ActiveSupport::Cache::MemoryStore.new
end
def test_cache_relation_other
cache(Project.all) { concat("Hello World") }
2017-05-18 12:12:32 -04:00
assert_equal "Hello World", controller.cache_store.read("views/path/projects-#{Project.count}")
end
def view_cache_dependencies; []; end
end