diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-08 21:13:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-08 21:13:02 +0300 |
commit | e7527f548681e4f9efd32f9c3da937ad74c68948 (patch) | |
tree | ef51227ccbbeb1accc8e3886870dbc6a168e8bb8 /spec/lib/gitlab | |
parent | f2ac9ee99ac6b1afc0edbc8621a05176dddd6a14 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/mail_room/mail_room_spec.rb | 3 | ||||
-rw-r--r-- | spec/lib/gitlab/redis/queues_spec.rb | 20 |
2 files changed, 19 insertions, 4 deletions
diff --git a/spec/lib/gitlab/mail_room/mail_room_spec.rb b/spec/lib/gitlab/mail_room/mail_room_spec.rb index a42da4ad3e0..0bd1a27c65e 100644 --- a/spec/lib/gitlab/mail_room/mail_room_spec.rb +++ b/spec/lib/gitlab/mail_room/mail_room_spec.rb @@ -93,7 +93,7 @@ RSpec.describe Gitlab::MailRoom do end describe 'setting up redis settings' do - let(:fake_redis_queues) { double(url: "localhost", sentinels: "yes, them", sentinels?: true) } + let(:fake_redis_queues) { double(url: "localhost", db: 99, sentinels: "yes, them", sentinels?: true) } before do allow(Gitlab::Redis::Queues).to receive(:new).and_return(fake_redis_queues) @@ -103,6 +103,7 @@ RSpec.describe Gitlab::MailRoom do config = described_class.enabled_configs.first expect(config[:redis_url]).to eq('localhost') + expect(config[:redis_db]).to eq(99) expect(config[:sentinels]).to eq('yes, them') end end diff --git a/spec/lib/gitlab/redis/queues_spec.rb b/spec/lib/gitlab/redis/queues_spec.rb index 2e396cde3bf..a0f73a654e7 100644 --- a/spec/lib/gitlab/redis/queues_spec.rb +++ b/spec/lib/gitlab/redis/queues_spec.rb @@ -9,10 +9,24 @@ RSpec.describe Gitlab::Redis::Queues do include_examples "redis_shared_examples" describe '#raw_config_hash' do - it 'has a legacy default URL' do - expect(subject).to receive(:fetch_config) { false } + before do + expect(subject).to receive(:fetch_config) { config } + end + + context 'when the config url is blank' do + let(:config) { nil } + + it 'has a legacy default URL' do + expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:6381' ) + end + end + + context 'when the config url is present' do + let(:config) { { url: 'redis://localhost:1111' } } - expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:6381' ) + it 'sets the configured url' do + expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:1111' ) + end end end end |