Remove unused test for Redis cache store (#9102)
This commit is contained in:
parent
9442fde9e7
commit
90c6e30972
1 changed files with 0 additions and 48 deletions
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue