diff options
Diffstat (limited to 'spec/requests/api/group_variables_spec.rb')
-rw-r--r-- | spec/requests/api/group_variables_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/requests/api/group_variables_spec.rb b/spec/requests/api/group_variables_spec.rb index c6d6ae1615b..41b013f49ee 100644 --- a/spec/requests/api/group_variables_spec.rb +++ b/spec/requests/api/group_variables_spec.rb @@ -169,6 +169,14 @@ RSpec.describe API::GroupVariables do expect(response).to have_gitlab_http_status(:not_found) end + + it 'responds with 400 if the update fails' do + put api("/groups/#{group.id}/variables/#{variable.key}", user), params: { value: 'shrt', masked: true } + + expect(response).to have_gitlab_http_status(:bad_request) + expect(variable.reload.masked).to eq(false) + expect(json_response['message']).to eq('value' => ['is invalid']) + end end context 'authorized user with invalid permissions' do |