Skip to content

Commit

Permalink
Added tests for config.action_controller.perform_caching
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
chetan authored and jeremy committed Apr 13, 2010
1 parent 0e27463 commit 9059472
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions railties/test/application/configuration_test.rb
Expand Up @@ -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

0 comments on commit 9059472

Please sign in to comment.