From 90594721779e1d3ab103989fb7d0a7c343b88662 Mon Sep 17 00:00:00 2001 From: Chetan Sarva Date: Tue, 13 Apr 2010 20:15:18 -0300 Subject: Added tests for config.action_controller.perform_caching Signed-off-by: Santiago Pastorino Signed-off-by: Jeremy Kemper --- railties/test/application/configuration_test.rb | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'railties/test/application/configuration_test.rb') 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 -- cgit v1.2.3