debian-mirror-gitlab/spec/lib/gitlab/redis/rate_limiting_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
614 B
Ruby
Raw Normal View History

2021-11-18 22:05:49 +05:30
# 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
2023-04-23 21:23:45 +05:30
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
2021-11-18 22:05:49 +05:30
end