Commit bdb06db0 authored by Kamil Trzciński's avatar Kamil Trzciński

Improve MetricGroup specs

parent a3fbaffc
......@@ -12,7 +12,8 @@ describe Gitlab::Prometheus::MetricGroup do
subject { described_class.common_metrics }
it 'returns exactly two groups' do
expect(subject.map(&:name)).to contain_exactly('Response metrics (AWS ELB)', 'System metrics (Kubernetes)')
expect(subject.map(&:name)).to contain_exactly(
'Response metrics (AWS ELB)', 'System metrics (Kubernetes)')
end
it 'returns exactly three metric queries' do
......@@ -27,10 +28,14 @@ describe Gitlab::Prometheus::MetricGroup do
let!(:project_metric) { create(:prometheus_metric) }
let!(:common_metric) { create(:prometheus_metric, :common, group: :aws_elb) }
subject { described_class.for_project(other_project) }
subject do
described_class.for_project(other_project)
.map(&:metrics).flatten
.map(&:id)
end
it 'returns exactly one common metric' do
expect(subject.map(&:metrics).flatten.map(&:id)).to contain_exactly(common_metric.id)
is_expected.to contain_exactly(common_metric.id)
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