diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index dd40f3d1561989d0bf2c39b5735bba5f977d8175..79c0a1953dc033185cb9862424e285f474f7ac39 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -1189,13 +1189,13 @@ describe API::MergeRequests do
     end
 
     it 'returns 404 if the merge request is not found' do
-      post api("/projects/#{project.id}/merge_requests/123/merge_when_pipeline_succeeds", user)
+      post api("/projects/#{project.id}/merge_requests/123/cancel_merge_when_pipeline_succeeds", user)
 
       expect(response).to have_gitlab_http_status(404)
     end
 
     it 'returns 404 if the merge request id is used instead of iid' do
-      post api("/projects/#{project.id}/merge_requests/#{merge_request.id}/merge_when_pipeline_succeeds", user)
+      post api("/projects/#{project.id}/merge_requests/#{merge_request.id}/cancel_merge_when_pipeline_succeeds", user)
 
       expect(response).to have_gitlab_http_status(404)
     end