Commit 1b7122a9 authored by Piotr Skorupa's avatar Piotr Skorupa

Fix alt_usage_data to properly return fallback in specs

This changes stubbing #alt_usage_data method to properly return fallback
data value - blindly stubbing as `-1` failed specs for certain JSON
schemas.
parent 8564ebfa
...@@ -75,7 +75,10 @@ RSpec.describe 'Every metric definition' do ...@@ -75,7 +75,10 @@ RSpec.describe 'Every metric definition' do
end end
before do before do
allow(Gitlab::UsageData).to receive_messages(count: -1, distinct_count: -1, estimate_batch_distinct_count: -1, sum: -1, alt_usage_data: -1) allow(Gitlab::UsageData).to receive_messages(count: -1, distinct_count: -1, estimate_batch_distinct_count: -1, sum: -1)
allow(Gitlab::UsageData).to receive(:alt_usage_data).and_wrap_original do |m, *args, **kwargs|
kwargs[:fallback] || Gitlab::Utils::UsageData::FALLBACK
end
allow(Gitlab::Geo).to receive(:enabled?).and_return(true) allow(Gitlab::Geo).to receive(:enabled?).and_return(true)
stub_licensed_features(requirements: true) stub_licensed_features(requirements: true)
stub_prometheus_queries stub_prometheus_queries
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment