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
success Entities::ErrorTracking::ProjectSetting
end
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
patch ':id/error_tracking/settings/' do
......
......@@ -55,6 +55,14 @@ describe API::ErrorTracking do
expect(json_response['error'])
.to eq('active is invalid')
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
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