From 90c6e309726fb266e1afb34dee9f9f2f63cbdc68 Mon Sep 17 00:00:00 2001 From: rhymes Date: Sun, 5 Jul 2020 21:13:19 +0200 Subject: [PATCH] Remove unused test for Redis cache store (#9102) --- .../cache/redis_cache_store_spec.rb | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 spec/initializers/active_support/cache/redis_cache_store_spec.rb diff --git a/spec/initializers/active_support/cache/redis_cache_store_spec.rb b/spec/initializers/active_support/cache/redis_cache_store_spec.rb deleted file mode 100644 index 8d134f39c..000000000 --- a/spec/initializers/active_support/cache/redis_cache_store_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -require "rails_helper" - -RSpec.describe ActiveSupport::Cache::RedisCacheStore do - let(:redis_client) { ActiveSupport::Cache.lookup_store(:redis_cache_store).redis } - let(:cache_db) { described_class.new } - let(:key) { "monkey_patch_test" } - - def value - cache_db.read(key, raw: true).to_i - end - - def pttl - redis_client.pttl(key) - end - - describe ".increment" do - before do - cache_db.delete(key) - end - - it "increments value without expires_in" do - cache_db.increment(key) - - expect(value).to eq(1) - expect(pttl).to eq(-1) - - cache_db.increment(key) - - expect(value).to eq(2) - expect(pttl).to eq(-1) - end - - it "increments value with expires_in" do - cache_db.increment(key, 1, expires_in: 100.seconds) - first_pttl = pttl - - expect(value).to eq(1) - expect(first_pttl > 0).to be_truthy - expect(first_pttl <= 100_000).to be_truthy - - cache_db.increment(key, 1, expires_in: 200.seconds) - second_pttl = pttl - - expect(value).to eq(2) - expect(second_pttl <= first_pttl).to be_truthy - end - end -end