Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added tests for config.action_controller.perform_caching

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 90594721779e1d3ab103989fb7d0a7c343b88662 1 parent 0e27463
@chetan chetan authored jeremy committed
Showing with 36 additions and 0 deletions.
  1. +36 −0 railties/test/application/configuration_test.rb
View
36 railties/test/application/configuration_test.rb
@@ -285,5 +285,41 @@ def index
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
Please sign in to comment.
Something went wrong with that request. Please try again.