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

rate_limiting_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: d82228426f008648878fe77319a87b5635728f02 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Redis::RateLimiting do
  include_examples "redis_new_instance_shared_examples", 'rate_limiting', Gitlab::Redis::Cache

  describe '.cache_store' do
    context 'when encountering an error' do
      subject { described_class.cache_store.read('x') }

      before do
        described_class.with do |redis|
          allow(redis).to receive(:get).and_raise(::Redis::CommandError)
        end
      end

      it 'logs error' do
        expect(::Gitlab::ErrorTracking).to receive(:log_exception)
        subject
      end
    end
  end
end