Address rubocop errors

This commit is contained in:
syasonik 2019-06-05 16:10:29 +01:00
parent 54dd44030b
commit cd94500a42
2 changed files with 5 additions and 3 deletions

View file

@ -16,8 +16,7 @@ module Gitlab
private
def endpoint_for_metric(metric)
Gitlab::Routing.url_helpers.prometheus_api_namespace_project_environment_path(
project.namespace,
Gitlab::Routing.url_helpers.prometheus_api_project_environment_path(
project,
environment,
proxy_path: query_type(metric),

View file

@ -11,11 +11,14 @@ describe Gitlab::Metrics::Dashboard::Processor do
let(:process_params) { [project, environment, dashboard_yml] }
let(:dashboard) { described_class.new(*process_params).process(insert_project_metrics: true) }
# rubocop:disable RSpec/IteratedExpectation
# Cop disabled "all" matcher doesn't offer access to the element
it 'includes a path for the prometheus endpoint with each metric' do
all_metrics.each do |metric|
expect(metric).to include(prometheus_endpoint_path: prometheus_path(metric[:query_range]))
end
end
# rubocop:enable RSpec/IteratedExpectation
context 'when dashboard config corresponds to common metrics' do
let!(:common_metric) { create(:prometheus_metric, :common, identifier: 'metric_a1') }
@ -114,6 +117,6 @@ describe Gitlab::Metrics::Dashboard::Processor do
"/#{project.namespace.path}" \
"/#{project.name}/environments/" \
"#{environment.id}/prometheus/api/v1" \
"/query_range?query=#{CGI::escape query}"
"/query_range?query=#{CGI.escape query}"
end
end