aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorChetan Sarva <chetan@pixelcop.net>2010-04-13 20:15:18 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-13 16:20:34 -0700
commit90594721779e1d3ab103989fb7d0a7c343b88662 (patch)
tree88002d04684531422f620f5ca9617db7829acdeb /railties
parent0e274639b495c358598bcc8d9ebbefceadd6045e (diff)
downloadrails-90594721779e1d3ab103989fb7d0a7c343b88662.tar.gz
rails-90594721779e1d3ab103989fb7d0a7c343b88662.tar.bz2
rails-90594721779e1d3ab103989fb7d0a7c343b88662.zip
Added tests for config.action_controller.perform_caching
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/configuration_test.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 8bf0f09d6b..0f3bc1a46a 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -285,5 +285,41 @@ module ApplicationTests
get "/"
assert last_response.body =~ /csrf\-param/
end
+
+ test "config.action_controller.perform_caching = true" do
+ make_basic_app do |app|
+ app.config.action_controller.perform_caching = true
+ end
+
+ class ::OmgController < ActionController::Base
+ caches_action :index
+ def index
+ render :text => rand(1000)
+ end
+ end
+
+ get "/"
+ res = last_response.body
+ get "/"
+ assert_equal res, last_response.body # value should be unchanged
+ end
+
+ test "config.action_controller.perform_caching = false" do
+ make_basic_app do |app|
+ app.config.action_controller.perform_caching = false
+ end
+
+ class ::OmgController < ActionController::Base
+ caches_action :index
+ def index
+ render :text => rand(1000)
+ end
+ end
+
+ get "/"
+ res = last_response.body
+ get "/"
+ assert_not_equal res, last_response.body
+ end
end
end