Commit 8b161d60 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'bug-fix-protect-branch' into 'master'

Handle 500 error for GraphQL "configureSast" mutation

See merge request gitlab-org/gitlab!43936
parents 12d0c1ad f69b5c9f
......@@ -22,6 +22,9 @@ module Security
end
result
rescue Gitlab::Git::PreReceiveError => e
{ status: :error, errors: e.message }
end
private
......
---
title: Handle 500 error for GraphQL "configureSast" mutation
merge_request: 43936
author:
type: fixed
......@@ -38,6 +38,12 @@ RSpec.describe Security::CiConfiguration::SastCreateService, :snowplow do
)
end
it 'raises exception if the user does not have permission to create a new branch' do
allow(project).to receive(:repository).and_raise(Gitlab::Git::PreReceiveError, "You are not allowed to create protected branches on this project.")
expect { subject }.to raise_error(Gitlab::Git::PreReceiveError)
end
context 'with no parameters' do
it 'returns the path to create a new merge request' do
expect(result[:status]).to eq(:success)
......
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