2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Redis::Cache do
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:instance_specific_config_file) { "config/redis.cache.yml" }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
include_examples "redis_shared_examples"
|
2021-09-04 01:27:46 +05:30
|
|
|
|
2022-08-27 11:52:29 +05:30
|
|
|
describe '.active_support_config' do
|
2022-10-11 01:57:18 +05:30
|
|
|
it 'has a default ttl of 8 hours' do
|
|
|
|
expect(described_class.active_support_config[:expires_in]).to eq(8.hours)
|
2022-08-27 11:52:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'allows configuring the TTL through an env variable' do
|
|
|
|
stub_env('GITLAB_RAILS_CACHE_DEFAULT_TTL_SECONDS' => '86400')
|
|
|
|
|
|
|
|
expect(described_class.active_support_config[:expires_in]).to eq(1.day)
|
|
|
|
end
|
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|