Improve MetricGroup specs
This commit is contained in:
		
							parent
							
								
									a3fbaffc0c
								
							
						
					
					
						commit
						bdb06db0f6
					
				|  | @ -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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue