Commit cbf93adf authored by Rajendra Kadam's avatar Rajendra Kadam

Add check for blank param value using allow_blank

parent ed364588
...@@ -29,7 +29,7 @@ module API ...@@ -29,7 +29,7 @@ module API
success Entities::ErrorTracking::ProjectSetting success Entities::ErrorTracking::ProjectSetting
end end
params do params do
requires :active, type: Boolean, desc: 'Specifying whether to enable or disable error tracking settings' requires :active, type: Boolean, desc: 'Specifying whether to enable or disable error tracking settings', allow_blank: false
end end
patch ':id/error_tracking/settings/' do patch ':id/error_tracking/settings/' do
......
...@@ -55,6 +55,14 @@ describe API::ErrorTracking do ...@@ -55,6 +55,14 @@ describe API::ErrorTracking do
expect(json_response['error']) expect(json_response['error'])
.to eq('active is invalid') .to eq('active is invalid')
end end
it 'returns 400 if active is empty' do
make_patch_request(active: '')
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error'])
.to eq('active is empty')
end
end end
context 'without a project setting' do context 'without a project setting' do
......
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