Commit 2a209048 authored by Kamil Trzciński's avatar Kamil Trzciński

Add EE specific MetricGroup specs

parent e33e4923
# frozen_string_literal: true
require 'rails_helper'
describe Gitlab::Prometheus::MetricGroup do
describe '.for_project' do
let!(:project_metric) { create(:prometheus_metric) }
let!(:common_metric) { create(:prometheus_metric, :common, group: :aws_elb) }
subject do
described_class.for_project(project)
.map(&:metrics).flatten
.map(&:id)
end
context 'for current project' do
let(:project) { project_metric.project }
it 'returns metrics for given project and common ones' do
is_expected.to contain_exactly(project_metric.id, common_metric.id)
end
end
context 'for other project' do
let(:project) { create(:project) }
it 'returns metrics only common ones' do
is_expected.to contain_exactly(common_metric.id)
end
end
end
end
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