Commit 06638bf5 authored by Sean Arnold's avatar Sean Arnold

Fix docs, add license check for update

parent cfcd67b8
......@@ -40,7 +40,6 @@ Example response:
}
```
## List metric images
```plaintext
......
......@@ -80,6 +80,8 @@ module API
authorize!(:update_alert_management_metric_image, alert)
render_api_error!('Not allowed!', 400) unless alert.metric_images_available?
metric_image = alert.metric_images.find_by_id(params[:metric_image_id])
render_api_error!('Metric image not found', 404) unless metric_image
......
......@@ -299,6 +299,11 @@ RSpec.describe API::AlertManagementAlerts do
project.add_developer(user)
end
context 'feature is enabled' do
before do
stub_licensed_features(alert_metric_upload: true)
end
context 'metric image not found' do
subject { put api("/projects/#{project.id}/alert_management_alerts/#{alert.iid}/metric_images/#{non_existing_record_id}", user) }
......@@ -321,5 +326,19 @@ RSpec.describe API::AlertManagementAlerts do
end
end
end
context 'feature not enabled' do
before do
stub_licensed_features(alert_metric_upload: false)
end
it 'returns an error' do
subject
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']).to eq('Not allowed!')
end
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