Added tests for config.action_controller.perform_caching

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
Chetan Sarva 2010-04-13 20:15:18 -03:00 committed by Jeremy Kemper
parent 0e274639b4
commit 9059472177
1 changed files with 36 additions and 0 deletions

View File

@ -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