diff options
Diffstat (limited to 'spec/requests/api/group_variables_spec.rb')
-rw-r--r-- | spec/requests/api/group_variables_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/requests/api/group_variables_spec.rb b/spec/requests/api/group_variables_spec.rb index 6849b087211..d0edc181b65 100644 --- a/spec/requests/api/group_variables_spec.rb +++ b/spec/requests/api/group_variables_spec.rb @@ -56,6 +56,7 @@ RSpec.describe API::GroupVariables, feature_category: :secrets_management do expect(json_response['protected']).to eq(variable.protected?) expect(json_response['variable_type']).to eq(variable.variable_type) expect(json_response['environment_scope']).to eq(variable.environment_scope) + expect(json_response['description']).to be_nil end it 'responds with 404 Not Found if requesting non-existing variable' do @@ -115,7 +116,7 @@ RSpec.describe API::GroupVariables, feature_category: :secrets_management do it 'creates variable with optional attributes' do expect do - post api("/groups/#{group.id}/variables", user), params: { variable_type: 'file', key: 'TEST_VARIABLE_2', value: 'VALUE_2' } + post api("/groups/#{group.id}/variables", user), params: { variable_type: 'file', key: 'TEST_VARIABLE_2', value: 'VALUE_2', description: 'description' } end.to change { group.variables.count }.by(1) expect(response).to have_gitlab_http_status(:created) @@ -126,6 +127,7 @@ RSpec.describe API::GroupVariables, feature_category: :secrets_management do expect(json_response['raw']).to be_falsey expect(json_response['variable_type']).to eq('file') expect(json_response['environment_scope']).to eq('*') + expect(json_response['description']).to eq('description') end it 'does not allow to duplicate variable key' do @@ -182,7 +184,7 @@ RSpec.describe API::GroupVariables, feature_category: :secrets_management do initial_variable = group.variables.reload.first value_before = initial_variable.value - put api("/groups/#{group.id}/variables/#{variable.key}", user), params: { variable_type: 'file', value: 'VALUE_1_UP', protected: true, masked: true, raw: true } + put api("/groups/#{group.id}/variables/#{variable.key}", user), params: { variable_type: 'file', value: 'VALUE_1_UP', protected: true, masked: true, raw: true, description: 'updated' } updated_variable = group.variables.reload.first @@ -193,6 +195,7 @@ RSpec.describe API::GroupVariables, feature_category: :secrets_management do expect(json_response['variable_type']).to eq('file') expect(json_response['masked']).to be_truthy expect(json_response['raw']).to be_truthy + expect(json_response['description']).to eq('updated') end it 'masks the new value when logging' do |