class FunctionalFragmentCachingTest

Public Instance Methods

setup() click to toggle source
# File test/controller/caching_test.rb, line 30
def setup
  super
  @store = ActiveSupport::Cache::MemoryStore.new
  @controller = FunctionalCachingController.new
  @controller.perform_caching = true
  @controller.cache_store = @store
  @request = ActionController::TestRequest.new
  @response = ActionController::TestResponse.new
end
test_fragment_caching_in_rjs_partials() click to toggle source
# File test/controller/caching_test.rb, line 40
def test_fragment_caching_in_rjs_partials
  xhr :get, :js_fragment_cached_with_partial
  assert_response :success
  assert_match(/Old fragment caching in a partial/, @response.body)
  assert_match("Old fragment caching in a partial", @store.read('views/test.host/functional_caching/js_fragment_cached_with_partial'))
end