diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb')
-rw-r--r-- | spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb b/spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb index 347a2c779cb..97306051533 100644 --- a/spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb +++ b/spec/lib/gitlab/usage/metrics/instrumentations/redis_hll_metric_spec.rb @@ -25,4 +25,28 @@ RSpec.describe Gitlab::Usage::Metrics::Instrumentations::RedisHLLMetric, :clean_ it 'raise exception if events options is not present' do expect { described_class.new(time_frame: '28d') }.to raise_error(ArgumentError) end + + describe 'children classes' do + let(:options) { { events: ['i_quickactions_approve'] } } + + context 'availability not defined' do + subject { Class.new(described_class).new(time_frame: nil, options: options) } + + it 'returns default availability' do + expect(subject.available?).to eq(true) + end + end + + context 'availability defined' do + subject do + Class.new(described_class) do + available? { false } + end.new(time_frame: nil, options: options) + end + + it 'returns defined availability' do + expect(subject.available?).to eq(false) + end + end + end end |