Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c694a608
Commit
c694a608
authored
Apr 01, 2020
by
Amy Troschinetz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create token response should be CREATED
parent
8013ec5b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
+9
-4
app/services/groups/deploy_tokens/create_service.rb
app/services/groups/deploy_tokens/create_service.rb
+1
-1
app/services/projects/deploy_tokens/create_service.rb
app/services/projects/deploy_tokens/create_service.rb
+1
-1
changelogs/unreleased/create-token--http-response.yml
changelogs/unreleased/create-token--http-response.yml
+5
-0
spec/controllers/groups/settings/ci_cd_controller_spec.rb
spec/controllers/groups/settings/ci_cd_controller_spec.rb
+1
-1
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+1
-1
No files found.
app/services/groups/deploy_tokens/create_service.rb
View file @
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
...
...
app/services/projects/deploy_tokens/create_service.rb
View file @
c694a608
...
...
@@ -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
...
...
changelogs/unreleased/create-token--http-response.yml
0 → 100644
View file @
c694a608
---
title
:
Token creation uses HTTP status CREATED
merge_request
:
28587
author
:
type
:
fixed
spec/controllers/groups/settings/ci_cd_controller_spec.rb
View file @
c694a608
...
...
@@ -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
...
...
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
c694a608
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment