blob: b0c7427fa81f9b3df465cba1aa84bff1ad219507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Projects::Ci::PrometheusMetrics::HistogramsController', feature_category: :pipeline_authoring do
let_it_be(:project) { create(:project, :public) }
describe 'POST /*namespace_id/:project_id/-/ci/prometheus_metrics/histograms' do
context 'with known histograms' do
it 'returns 201 Created' do
post histograms_route(histograms:
[
{ name: :pipeline_graph_link_calculation_duration_seconds, value: 1 },
{ name: :pipeline_graph_links_total, value: 10 }
])
expect(response).to have_gitlab_http_status(:created)
end
end
context 'with unknown histograms' do
it 'returns 404 Not Found' do
post histograms_route(histograms: [{ name: :chunky_bacon, value: 5 }])
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
def histograms_route(params = {})
namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: project.namespace, project_id: project, **params)
end
end
|