diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-24 09:54:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-24 09:54:29 +0100 |
commit | 39081f166023092041605144c87d7a6cd3b65102 (patch) | |
tree | bd7422f677929c214f1a0c3f9a60288b5581706b /actionpack/test/controller | |
parent | 7b1ac55f50bd580a8a9c6e9bfa8b178f1ab6f443 (diff) | |
download | rails-39081f166023092041605144c87d7a6cd3b65102.tar.gz rails-39081f166023092041605144c87d7a6cd3b65102.tar.bz2 rails-39081f166023092041605144c87d7a6cd3b65102.zip |
Provide a class optin for page_cache_compression.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index dfebb29da3..34a38a5567 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -14,6 +14,8 @@ class CachingController < ActionController::Base end class PageCachingTestController < CachingController + self.page_cache_compression = :best_compression + caches_page :ok, :no_content, :if => Proc.new { |c| !c.request.format.json? } caches_page :found, :not_found caches_page :about_me @@ -21,7 +23,6 @@ class PageCachingTestController < CachingController caches_page :no_gzip, :gzip => false caches_page :gzip_level, :gzip => :best_speed - def ok head :ok end @@ -144,7 +145,7 @@ class PageCachingTest < ActionController::TestCase assert !File.exist?("#{FILE_STORE_PATH}/page_caching_test/no_gzip.html.gz") end - def test_should_use_best_gzip_by_default + def test_should_use_config_gzip_by_default @controller.expects(:cache_page).with(nil, nil, Zlib::BEST_COMPRESSION) get :default_gzip end @@ -233,7 +234,7 @@ class ActionCachingTestController < CachingController caches_action :show, :cache_path => 'http://test.host/custom/show' caches_action :edit, :cache_path => Proc.new { |c| c.params[:id] ? "http://test.host/#{c.params[:id]};edit" : "http://test.host/edit" } caches_action :with_layout - caches_action :with_format_and_http_param, :cache_path => Proc.new { |c| { :key => 'value' } } + caches_action :with_format_and_http_param, :cache_path => Proc.new { |c| { :key => 'value' } } caches_action :layout_false, :layout => false caches_action :record_not_found, :four_oh_four, :simple_runtime_error |