Commit 554f8e38 authored by Jasper Maes's avatar Jasper Maes

Rails 5 fix alerts controller spec for post json parameters

parent 9e821920
---
title: Rails 5 fix alerts controller spec for post json parameters
merge_request: 6795
author: Jasper Maes
type: fixed
......@@ -100,7 +100,11 @@ describe Projects::Prometheus::AlertsController do
allow(NotificationService).to receive(:new).and_return(notification_service)
expect(notification_service).to receive_message_chain(:async, :prometheus_alerts_fired).with(project, [alert_params])
post :notify, project_params(alerts: [alert])
if Gitlab.rails5?
post :notify, params: project_params(alerts: [alert.to_param]), as: :json
else
post :notify, project_params(alerts: [alert]), as: :json
end
expect(response).to have_gitlab_http_status(200)
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