Commit 4396947e authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch 'create-token--http-response' into 'master'

Create token response should be CREATED

See merge request gitlab-org/gitlab!28587
parents 59bee145 c694a608
......@@ -9,7 +9,7 @@ module Groups
deploy_token = create_deploy_token_for(@group, params)
if deploy_token.persisted?
success(deploy_token: deploy_token, http_status: :ok)
success(deploy_token: deploy_token, http_status: :created)
else
error(deploy_token.errors.full_messages.to_sentence, :bad_request)
end
......
......@@ -9,7 +9,7 @@ module Projects
deploy_token = create_deploy_token_for(@project, params)
if deploy_token.persisted?
success(deploy_token: deploy_token, http_status: :ok)
success(deploy_token: deploy_token, http_status: :created)
else
error(deploy_token.errors.full_messages.to_sentence, :bad_request)
end
......
---
title: Token creation uses HTTP status CREATED
merge_request: 28587
author:
type: fixed
......@@ -267,7 +267,7 @@ describe Groups::Settings::CiCdController do
it 'creates the deploy token' do
subject
expect(response).to have_gitlab_http_status(:ok)
expect(response).to have_gitlab_http_status(:created)
expect(response).to match_response_schema('public_api/v4/deploy_token')
expect(json_response).to match(expected_response)
end
......
......@@ -300,7 +300,7 @@ describe Projects::Settings::CiCdController do
it 'creates the deploy token' do
subject
expect(response).to have_gitlab_http_status(:ok)
expect(response).to have_gitlab_http_status(:created)
expect(response).to match_response_schema('public_api/v4/deploy_token')
expect(json_response).to match(expected_response)
end
......
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