aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/cache
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-07-01 12:42:18 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2018-07-01 12:46:15 +0200
commit969577d960cd7e2d0a421af4a987f56894c3b229 (patch)
treeea6aa0f608aa255e0e49a6d0970baedf6dca92e5 /activesupport/test/cache
parentf666fb58a3d7b56461d9aac04411022aaa86c0c7 (diff)
downloadrails-969577d960cd7e2d0a421af4a987f56894c3b229.tar.gz
rails-969577d960cd7e2d0a421af4a987f56894c3b229.tar.bz2
rails-969577d960cd7e2d0a421af4a987f56894c3b229.zip
Refactor #33254.
Firstly, increment and decrement shouldn't care about the particulars of key expiry. They should only know that they have to pass that responsibility on to somewhere else. Secondly, it moves the key normalization back inside the instrumentation like it was originally. I think that matches the original design intention or at the very least it lets users catch haywire key truncation. Thirdly, it moves the changelog entry to the top of the file, where new entries go. I couldn't understand what the entry was saying so I tried to rewrite it.
Diffstat (limited to 'activesupport/test/cache')
-rw-r--r--activesupport/test/cache/stores/redis_cache_store_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/test/cache/stores/redis_cache_store_test.rb b/activesupport/test/cache/stores/redis_cache_store_test.rb
index 845254ac69..3b873de383 100644
--- a/activesupport/test/cache/stores/redis_cache_store_test.rb
+++ b/activesupport/test/cache/stores/redis_cache_store_test.rb
@@ -152,7 +152,7 @@ module ActiveSupport::Cache::RedisCacheStoreTests
# key and ttl exist
@cache.redis.setex "#{@namespace}:bar", 120, 1
assert_not_called @cache.redis, :expire do
- @cache.increment "bar", 1, expires_in: 120
+ @cache.increment "bar", 1, expires_in: 2.minutes
end
# key exist but not have expire
@@ -172,7 +172,7 @@ module ActiveSupport::Cache::RedisCacheStoreTests
# key and ttl exist
@cache.redis.setex "#{@namespace}:bar", 120, 1
assert_not_called @cache.redis, :expire do
- @cache.decrement "bar", 1, expires_in: 120
+ @cache.decrement "bar", 1, expires_in: 2.minutes
end
# key exist but not have expire