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::Queues do
|
2021-09-04 01:27:46 +05:30
|
|
|
let(:instance_specific_config_file) { "config/redis.queues.yml" }
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:environment_config_file_name) { "GITLAB_REDIS_QUEUES_CONFIG_FILE" }
|
|
|
|
|
|
|
|
include_examples "redis_shared_examples"
|
2021-09-04 01:27:46 +05:30
|
|
|
|
|
|
|
describe '#raw_config_hash' do
|
2021-11-18 22:05:49 +05:30
|
|
|
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' } }
|
2021-09-04 01:27:46 +05:30
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
it 'sets the configured url' do
|
|
|
|
expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:1111' )
|
|
|
|
end
|
2021-09-04 01:27:46 +05:30
|
|
|
end
|
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|