Welcome to mirror list, hosted at ThFree Co, Russian Federation.

queues_spec.rb « redis « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a0f73a654e7f51ff0b45d9ca049a0059aadfd8b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Redis::Queues do
  let(:instance_specific_config_file) { "config/redis.queues.yml" }
  let(:environment_config_file_name) { "GITLAB_REDIS_QUEUES_CONFIG_FILE" }

  include_examples "redis_shared_examples"

  describe '#raw_config_hash' do
    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' } }

      it 'sets the configured url' do
        expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:1111' )
      end
    end
  end
end