diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/initializers | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/initializers')
-rw-r--r-- | spec/initializers/doorkeeper_spec.rb | 2 | ||||
-rw-r--r-- | spec/initializers/session_store_spec.rb | 36 |
2 files changed, 4 insertions, 34 deletions
diff --git a/spec/initializers/doorkeeper_spec.rb b/spec/initializers/doorkeeper_spec.rb index 164225a00b2..56e0a22d59f 100644 --- a/spec/initializers/doorkeeper_spec.rb +++ b/spec/initializers/doorkeeper_spec.rb @@ -24,7 +24,7 @@ RSpec.describe Doorkeeper.configuration do before do allow(controller).to receive(:current_user).and_return(current_user) allow(controller).to receive(:session).and_return({}) - allow(controller).to receive(:request).and_return(OpenStruct.new(fullpath: '/return-path')) + allow(controller).to receive(:request).and_return(double('request', fullpath: '/return-path')) allow(controller).to receive(:redirect_to) allow(controller).to receive(:new_user_session_url).and_return('/login') end diff --git a/spec/initializers/session_store_spec.rb b/spec/initializers/session_store_spec.rb index db90b335dc9..a94ce327a92 100644 --- a/spec/initializers/session_store_spec.rb +++ b/spec/initializers/session_store_spec.rb @@ -10,40 +10,10 @@ RSpec.describe 'Session initializer for GitLab' do end describe 'config#session_store' do - context 'when the GITLAB_USE_REDIS_SESSIONS_STORE env is not set' do - before do - stub_env('GITLAB_USE_REDIS_SESSIONS_STORE', nil) - 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))) - 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_USE_REDIS_SESSIONS_STORE env is disabled' do - before do - 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(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 + load_session_store end end end |