diff options
Diffstat (limited to 'spec/initializers/session_store_spec.rb')
-rw-r--r-- | spec/initializers/session_store_spec.rb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/spec/initializers/session_store_spec.rb b/spec/initializers/session_store_spec.rb index 3da52ccc981..db90b335dc9 100644 --- a/spec/initializers/session_store_spec.rb +++ b/spec/initializers/session_store_spec.rb @@ -10,25 +10,37 @@ RSpec.describe 'Session initializer for GitLab' do end describe 'config#session_store' do - context 'when the GITLAB_REDIS_STORE_WITH_SESSION_STORE env is not set' do + context 'when the GITLAB_USE_REDIS_SESSIONS_STORE env is not set' do before do - stub_env('GITLAB_REDIS_STORE_WITH_SESSION_STORE', nil) + stub_env('GITLAB_USE_REDIS_SESSIONS_STORE', nil) end - it 'initialized as a redis_store with a proper Redis::Store instance' do + it 'initialized with Multistore as ENV var defaults to true' do expect(subject).to receive(:session_store).with(:redis_store, a_hash_including(redis_store: kind_of(::Redis::Store))) load_session_store end end - context 'when the GITLAB_REDIS_STORE_WITH_SESSION_STORE env is disabled' do + context 'when the GITLAB_USE_REDIS_SESSIONS_STORE env is disabled' do before do - stub_env('GITLAB_REDIS_STORE_WITH_SESSION_STORE', false) + stub_env('GITLAB_USE_REDIS_SESSIONS_STORE', false) end it 'initialized as a redis_store with a proper servers configuration' do - expect(subject).to receive(:session_store).with(:redis_store, a_hash_including(servers: kind_of(Hash))) + expect(subject).to receive(:session_store).with(:redis_store, a_hash_including(redis_store: kind_of(Redis::Store))) + + load_session_store + end + end + + context 'when the GITLAB_USE_REDIS_SESSIONS_STORE env is enabled' do + before do + stub_env('GITLAB_USE_REDIS_SESSIONS_STORE', true) + end + + it 'initialized as a redis_store with a proper servers configuration' do + expect(subject).to receive(:session_store).with(:redis_store, a_hash_including(redis_store: kind_of(::Redis::Store))) load_session_store end |