class FragmentCacheKeyTest
Public Instance Methods
setup()
click to toggle source
Calls superclass method
# File actionpack/test/controller/caching_test.rb, line 478 def setup super @store = ActiveSupport::Cache::MemoryStore.new @controller = FragmentCacheKeyTestController.new @controller.perform_caching = true @controller.cache_store = @store end
test_combined_fragment_cache_key()
click to toggle source
# File actionpack/test/controller/caching_test.rb, line 486 def test_combined_fragment_cache_key @controller.account_id = "123" assert_equal [ :views, "v1", "123", "what a key" ], @controller.combined_fragment_cache_key("what a key") @controller.account_id = nil assert_equal [ :views, "v1", "what a key" ], @controller.combined_fragment_cache_key("what a key") end
test_combined_fragment_cache_key_with_envs()
click to toggle source
# File actionpack/test/controller/caching_test.rb, line 494 def test_combined_fragment_cache_key_with_envs ENV["RAILS_APP_VERSION"] = "55" assert_equal [ :views, "55", "v1", "what a key" ], @controller.combined_fragment_cache_key("what a key") ENV["RAILS_CACHE_ID"] = "66" assert_equal [ :views, "66", "v1", "what a key" ], @controller.combined_fragment_cache_key("what a key") ensure ENV["RAILS_CACHE_ID"] = ENV["RAILS_APP_VERSION"] = nil end