diff options
Diffstat (limited to 'spec/lib/gitlab/redis/queues_spec.rb')
-rw-r--r-- | spec/lib/gitlab/redis/queues_spec.rb | 20 |
1 files changed, 17 insertions, 3 deletions
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 |