BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5805e922
Commit
5805e922
authored
May 28, 2018
by
Kamil Trzciński
Committed by
Dylan Griffith
May 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Runners API validations
parent
385f37a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
runners.rb
lib/api/runners.rb
+1
-1
runners_spec.rb
spec/requests/api/runners_spec.rb
+2
-6
No files found.
lib/api/runners.rb
View file @
5805e922
...
...
@@ -136,7 +136,7 @@ module API
if
runner
.
assign_to
(
user_project
)
present
runner
,
with:
Entities
::
Runner
else
conflict!
(
"Runner was already enabled for this project"
)
render_validation_error!
(
runner
)
end
end
...
...
spec/requests/api/runners_spec.rb
View file @
5805e922
...
...
@@ -522,11 +522,7 @@ describe API::Runners do
describe
'POST /projects/:id/runners'
do
context
'authorized user'
do
let
(
:project_runner2
)
do
create
(
:ci_runner
).
tap
do
|
runner
|
create
(
:ci_runner_project
,
runner:
runner
,
project:
project2
)
end
end
let
(
:project_runner2
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project2
])
}
it
'enables specific runner'
do
expect
do
...
...
@@ -539,7 +535,7 @@ describe API::Runners do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/runners"
,
user
),
runner_id:
project_runner
.
id
end
.
to
change
{
project
.
runners
.
count
}.
by
(
0
)
expect
(
response
).
to
have_gitlab_http_status
(
40
9
)
expect
(
response
).
to
have_gitlab_http_status
(
40
0
)
end
it
'does not enable locked runner'
do
...
...
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