diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 12:08:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 12:08:48 +0000 |
commit | f7dae0cdcb70ecb71c1d65f099e9d96b27a4548c (patch) | |
tree | e53baffa847c4fd37c8e335e4d93d603c75f9f02 /spec/requests/api/group_variables_spec.rb | |
parent | b98fa9ef3d5bead417ae2f325cb64637883264e9 (diff) | |
download | gitlab-ce-f7dae0cdcb70ecb71c1d65f099e9d96b27a4548c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/group_variables_spec.rb')
-rw-r--r-- | spec/requests/api/group_variables_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/requests/api/group_variables_spec.rb b/spec/requests/api/group_variables_spec.rb index 3f9e80e6613..a5b48985df5 100644 --- a/spec/requests/api/group_variables_spec.rb +++ b/spec/requests/api/group_variables_spec.rb @@ -17,7 +17,7 @@ describe API::GroupVariables do it 'returns group variables' do get api("/groups/#{group.id}/variables", user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_a(Array) end end @@ -26,7 +26,7 @@ describe API::GroupVariables do it 'does not return group variables' do get api("/groups/#{group.id}/variables", user) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -34,7 +34,7 @@ describe API::GroupVariables do it 'does not return group variables' do get api("/groups/#{group.id}/variables") - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -50,7 +50,7 @@ describe API::GroupVariables do it 'returns group variable details' do get api("/groups/#{group.id}/variables/#{variable.key}", user) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['value']).to eq(variable.value) expect(json_response['protected']).to eq(variable.protected?) expect(json_response['variable_type']).to eq(variable.variable_type) @@ -59,7 +59,7 @@ describe API::GroupVariables do it 'responds with 404 Not Found if requesting non-existing variable' do get api("/groups/#{group.id}/variables/non_existing_variable", user) - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -67,7 +67,7 @@ describe API::GroupVariables do it 'does not return group variable details' do get api("/groups/#{group.id}/variables/#{variable.key}", user) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -75,7 +75,7 @@ describe API::GroupVariables do it 'does not return group variable details' do get api("/groups/#{group.id}/variables/#{variable.key}") - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -93,7 +93,7 @@ describe API::GroupVariables do 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(response).to have_gitlab_http_status(:created) 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 @@ -106,7 +106,7 @@ describe API::GroupVariables do post api("/groups/#{group.id}/variables", user), params: { variable_type: 'file', key: 'TEST_VARIABLE_2', value: 'VALUE_2' } end.to change {group.variables.count}.by(1) - expect(response).to have_gitlab_http_status(201) + expect(response).to have_gitlab_http_status(:created) expect(json_response['key']).to eq('TEST_VARIABLE_2') expect(json_response['value']).to eq('VALUE_2') expect(json_response['protected']).to be_falsey @@ -119,7 +119,7 @@ describe API::GroupVariables do post api("/groups/#{group.id}/variables", user), params: { key: variable.key, value: 'VALUE_2' } end.to change {group.variables.count}.by(0) - expect(response).to have_gitlab_http_status(400) + expect(response).to have_gitlab_http_status(:bad_request) end end @@ -127,7 +127,7 @@ describe API::GroupVariables do it 'does not create variable' do post api("/groups/#{group.id}/variables", user) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -135,7 +135,7 @@ describe API::GroupVariables do it 'does not create variable' do post api("/groups/#{group.id}/variables") - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -156,7 +156,7 @@ describe API::GroupVariables do updated_variable = group.variables.reload.first - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(value_before).to eq(variable.value) expect(updated_variable.value).to eq('VALUE_1_UP') expect(updated_variable).to be_protected @@ -167,7 +167,7 @@ describe API::GroupVariables do it 'responds with 404 Not Found if requesting non-existing variable' do put api("/groups/#{group.id}/variables/non_existing_variable", user) - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -175,7 +175,7 @@ describe API::GroupVariables do it 'does not update variable' do put api("/groups/#{group.id}/variables/#{variable.key}", user) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -183,7 +183,7 @@ describe API::GroupVariables do it 'does not update variable' do put api("/groups/#{group.id}/variables/#{variable.key}") - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -200,14 +200,14 @@ describe API::GroupVariables do expect do delete api("/groups/#{group.id}/variables/#{variable.key}", user) - expect(response).to have_gitlab_http_status(204) + expect(response).to have_gitlab_http_status(:no_content) end.to change {group.variables.count}.by(-1) end it 'responds with 404 Not Found if requesting non-existing variable' do delete api("/groups/#{group.id}/variables/non_existing_variable", user) - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end it_behaves_like '412 response' do @@ -219,7 +219,7 @@ describe API::GroupVariables do it 'does not delete variable' do delete api("/groups/#{group.id}/variables/#{variable.key}", user) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -227,7 +227,7 @@ describe API::GroupVariables do it 'does not delete variable' do delete api("/groups/#{group.id}/variables/#{variable.key}") - expect(response).to have_gitlab_http_status(401) + expect(response).to have_gitlab_http_status(:unauthorized) end end end |