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:
parent
0e274639b4
commit
9059472177
|
@ -285,5 +285,41 @@ module ApplicationTests
|
||||||
get "/"
|
get "/"
|
||||||
assert last_response.body =~ /csrf\-param/
|
assert last_response.body =~ /csrf\-param/
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue