aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
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