summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/usage/metrics/query_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/lib/gitlab/usage/metrics/query_spec.rb
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/lib/gitlab/usage/metrics/query_spec.rb')
-rw-r--r--spec/lib/gitlab/usage/metrics/query_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage/metrics/query_spec.rb b/spec/lib/gitlab/usage/metrics/query_spec.rb
index 65b8a7a046b..355d619f768 100644
--- a/spec/lib/gitlab/usage/metrics/query_spec.rb
+++ b/spec/lib/gitlab/usage/metrics/query_spec.rb
@@ -61,6 +61,12 @@ RSpec.describe Gitlab::Usage::Metrics::Query do
end
end
+ describe '.average' do
+ it 'returns the raw SQL' do
+ expect(described_class.for(:average, Issue, :weight)).to eq('SELECT AVG("issues"."weight") FROM "issues"')
+ end
+ end
+
describe 'estimate_batch_distinct_count' do
it 'returns the raw SQL' do
expect(described_class.for(:estimate_batch_distinct_count, Issue, :author_id)).to eq('SELECT COUNT(DISTINCT "issues"."author_id") FROM "issues"')