diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 18:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 18:09:10 +0300 |
commit | 7f79d4c409705a05bcf5e11dbe6e8738b0e17fe6 (patch) | |
tree | 33d2cc91b6b82a907e2eef019590119e1573e2a3 /spec/requests/api | |
parent | ae78b85a25cb0c19c3d6a2e4e6c7ca91ed50787d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api')
-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 abdc3a40360..3f9e80e6613 100644 --- a/spec/requests/api/group_variables_spec.rb +++ b/spec/requests/api/group_variables_spec.rb @@ -90,13 +90,14 @@ describe API::GroupVariables do it 'creates variable' do expect do - post api("/groups/#{group.id}/variables", user), params: { key: 'TEST_VARIABLE_2', value: 'PROTECTED_VALUE_2', protected: true } + post api("/groups/#{group.id}/variables", user), params: { key: 'TEST_VARIABLE_2', value: 'PROTECTED_VALUE_2', protected: true, masked: true } end.to change {group.variables.count}.by(1) expect(response).to have_gitlab_http_status(201) expect(json_response['key']).to eq('TEST_VARIABLE_2') expect(json_response['value']).to eq('PROTECTED_VALUE_2') expect(json_response['protected']).to be_truthy + expect(json_response['masked']).to be_truthy expect(json_response['variable_type']).to eq('env_var') end @@ -109,6 +110,7 @@ describe API::GroupVariables do expect(json_response['key']).to eq('TEST_VARIABLE_2') expect(json_response['value']).to eq('VALUE_2') expect(json_response['protected']).to be_falsey + expect(json_response['masked']).to be_falsey expect(json_response['variable_type']).to eq('file') end @@ -150,7 +152,7 @@ describe API::GroupVariables 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 } + put api("/groups/#{group.id}/variables/#{variable.key}", user), params: { variable_type: 'file', value: 'VALUE_1_UP', protected: true, masked: true } updated_variable = group.variables.reload.first @@ -159,6 +161,7 @@ describe API::GroupVariables do expect(updated_variable.value).to eq('VALUE_1_UP') expect(updated_variable).to be_protected expect(json_response['variable_type']).to eq('file') + expect(json_response['masked']).to be_truthy end it 'responds with 404 Not Found if requesting non-existing variable' do |