Methods
- S
- T
Instance Public methods
setup()
Link
# File actionpack/test/controller/caching_test.rb, line 815 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()
Link
# File actionpack/test/controller/caching_test.rb, line 825 def test_fragment_caching get :fragment_cached assert_response :success expected_body = <<-CACHED Hello This bit's fragment cached Ciao CACHED assert_equal expected_body, @response.body assert_equal "This bit's fragment cached", @store.read('views/test.host/functional_caching/fragment_cached') end
test_fragment_caching_in_partials()
Link
# File actionpack/test/controller/caching_test.rb, line 838 def test_fragment_caching_in_partials get :html_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/html_fragment_cached_with_partial')) end
test_html_formatted_fragment_caching()
Link
# File actionpack/test/controller/caching_test.rb, line 853 def test_html_formatted_fragment_caching get :formatted_fragment_cached, :format => "html" 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/test.host/functional_caching/formatted_fragment_cached') end
test_render_inline_before_fragment_caching()
Link
# File actionpack/test/controller/caching_test.rb, line 845 def test_render_inline_before_fragment_caching get :inline_fragment_cached assert_response :success assert_match(/Some inline content/, @response.body) assert_match(/Some cached content/, @response.body) assert_match("Some cached content", @store.read('views/test.host/functional_caching/inline_fragment_cached')) end
test_xml_formatted_fragment_caching()
Link
# File actionpack/test/controller/caching_test.rb, line 863 def test_xml_formatted_fragment_caching get :formatted_fragment_cached, :format => "xml" assert_response :success expected_body = "<body>\n <p>Builder</p>\n</body>\n" assert_equal expected_body, @response.body assert_equal " <p>Builder</p>\n", @store.read('views/test.host/functional_caching/formatted_fragment_cached') end