aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorAngelo capilleri <capilleri@yahoo.com>2012-12-12 18:26:38 +0100
committerAngelo capilleri <capilleri@yahoo.com>2012-12-14 17:51:52 +0100
commit83223424b33e332673fc3e4bdcae7477e601377f (patch)
tree437a668dc56c84b7defc5c0e4913386f86c9b7fd /actionpack/test/controller
parentd4333eded218346eb8b8313f7c69851782f594ef (diff)
downloadrails-83223424b33e332673fc3e4bdcae7477e601377f.tar.gz
rails-83223424b33e332673fc3e4bdcae7477e601377f.tar.bz2
rails-83223424b33e332673fc3e4bdcae7477e601377f.zip
Removed :if and :unless from fragment cache option in favour of
cache_if(condition, option, &block) and cache_unless(condition, option, &block). In the PR #8371 was introduced conditional options :if and :unless in the cache method. Example: <%= cache @model, if: some_condition(@model) do %> ... <%end%> This is a good feature but *cache_if* and and *cache_unless* are more concise and close to the standard of rails view helpers (ex: link_to_if and link_to_unless). Example: <%= cache_if condition, @model do %> ... <%end%>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/log_subscriber_test.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb
index 929545fc10..075347be52 100644
--- a/actionpack/test/controller/log_subscriber_test.rb
+++ b/actionpack/test/controller/log_subscriber_test.rb
@@ -46,20 +46,20 @@ module Another
render :inline => "<%= cache('foo%bar'){ 'Contains % sign in key' } %>"
end
- def with_fragment_cache_and_if_true_condition
- render :inline => "<%= cache('foo', :if => true) { 'bar' } %>"
+ def with_fragment_cache_if_with_true_condition
+ render :inline => "<%= cache_if(true, 'foo') { 'bar' } %>"
end
- def with_fragment_cache_and_if_false_condition
- render :inline => "<%= cache('foo', :if => false) { 'bar' } %>"
+ def with_fragment_cache_if_with_false_condition
+ render :inline => "<%= cache_if(false, 'foo') { 'bar' } %>"
end
- def with_fragment_cache_and_unless_false_condition
- render :inline => "<%= cache('foo', :unless => false) { 'bar' } %>"
+ def with_fragment_cache_unless_with_false_condition
+ render :inline => "<%= cache_unless(false, 'foo') { 'bar' } %>"
end
- def with_fragment_cache_and_unless_true_condition
- render :inline => "<%= cache('foo', :unless => true) { 'bar' } %>"
+ def with_fragment_cache_unless_with_true_condition
+ render :inline => "<%= cache_unless(true, 'foo') { 'bar' } %>"
end
def with_exception
@@ -219,9 +219,9 @@ class ACLogSubscriberTest < ActionController::TestCase
@controller.config.perform_caching = true
end
- def test_with_fragment_cache_and_if_true
+ def test_with_fragment_cache_if_with_true
@controller.config.perform_caching = true
- get :with_fragment_cache_and_if_true_condition
+ get :with_fragment_cache_if_with_true_condition
wait
assert_equal 4, logs.size
@@ -231,9 +231,9 @@ class ACLogSubscriberTest < ActionController::TestCase
@controller.config.perform_caching = true
end
- def test_with_fragment_cache_and_if_false
+ def test_with_fragment_cache_if_with_false
@controller.config.perform_caching = true
- get :with_fragment_cache_and_if_false_condition
+ get :with_fragment_cache_if_with_false_condition
wait
assert_equal 2, logs.size
@@ -243,9 +243,9 @@ class ACLogSubscriberTest < ActionController::TestCase
@controller.config.perform_caching = true
end
- def test_with_fragment_cache_and_unless_true
+ def test_with_fragment_cache_unless_with_true
@controller.config.perform_caching = true
- get :with_fragment_cache_and_unless_true_condition
+ get :with_fragment_cache_unless_with_true_condition
wait
assert_equal 2, logs.size
@@ -255,9 +255,9 @@ class ACLogSubscriberTest < ActionController::TestCase
@controller.config.perform_caching = true
end
- def test_with_fragment_cache_and_unless_false
+ def test_with_fragment_cache_unless_with_false
@controller.config.perform_caching = true
- get :with_fragment_cache_and_unless_false_condition
+ get :with_fragment_cache_unless_with_false_condition
wait
assert_equal 4, logs.size