From 39081f166023092041605144c87d7a6cd3b65102 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@gmail.com>
Date: Sat, 24 Dec 2011 09:54:29 +0100
Subject: Provide a class optin for page_cache_compression.

---
 actionpack/test/controller/caching_test.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'actionpack/test')

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
 
-- 
cgit v1.2.3