Methods
- S
- T
-
- teardown,
- test_cached_page_should_not_have_trailing_slash_even_if_url_has_trailing_slash,
- test_page_caching_conditional_options,
- test_page_caching_directory_set_as_pathname,
- test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route,
- test_should_allow_to_disable_gzip,
- test_should_cache_get_with_ok_status,
- test_should_cache_ok_at_custom_path,
- test_should_cache_with_custom_path,
- test_should_cache_without_trailing_slash_on_url,
- test_should_expire_cache_with_custom_path,
- test_should_gzip_cache,
- test_should_obey_http_accept_attribute,
- test_should_set_gzip_level,
- test_should_use_config_gzip_by_default
Instance Public methods
setup()
Link
# File actionpack/test/controller/caching_test.rb, line 78 def setup super @request = ActionController::TestRequest.new @request.host = 'hostname.com' @request.env.delete('PATH_INFO') @controller = PageCachingTestController.new @controller.perform_caching = true @controller.cache_store = :file_store, FILE_STORE_PATH @response = ActionController::TestResponse.new @params = {:controller => 'posts', :action => 'index', :only_path => true} FileUtils.rm_rf(File.dirname(FILE_STORE_PATH)) FileUtils.mkdir_p(FILE_STORE_PATH) end
teardown()
Link
test_cached_page_should_not_have_trailing_slash_even_if_url_has_trailing_slash()
Link
# File actionpack/test/controller/caching_test.rb, line 170 def test_cached_page_should_not_have_trailing_slash_even_if_url_has_trailing_slash @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash/' assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") end
test_page_caching_conditional_options()
Link
test_page_caching_directory_set_as_pathname()
Link
# File actionpack/test/controller/caching_test.rb, line 199 def test_page_caching_directory_set_as_pathname begin ActionController::Base.page_cache_directory = Pathname.new(FILE_STORE_PATH) get :ok assert_response :ok assert_page_cached :ok ensure ActionController::Base.page_cache_directory = FILE_STORE_PATH end end
test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route()
Link
# File actionpack/test/controller/caching_test.rb, line 102 def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route with_routing do |set| set.draw do match 'posts.:format', :to => 'posts#index', :as => :formatted_posts match '/', :to => 'posts#index', :as => :main end @params[:format] = 'rss' assert_equal '/posts.rss', @routes.url_for(@params) @params[:format] = nil assert_equal '/', @routes.url_for(@params) end end
test_should_allow_to_disable_gzip()
Link
test_should_cache_get_with_ok_status()
Link
test_should_cache_ok_at_custom_path()
Link
test_should_cache_with_custom_path()
Link
test_should_cache_without_trailing_slash_on_url()
Link
# File actionpack/test/controller/caching_test.rb, line 158 def test_should_cache_without_trailing_slash_on_url @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash' assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") end
test_should_expire_cache_with_custom_path()
Link
test_should_gzip_cache()
Link
test_should_obey_http_accept_attribute()
Link
test_should_set_gzip_level()
Link