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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
4eb27d7c
Commit
4eb27d7c
authored
Jan 08, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some modifications to builds API and specs
parent
d54bff2a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lib/api/builds.rb
lib/api/builds.rb
+1
-1
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+4
-4
No files found.
lib/api/builds.rb
View file @
4eb27d7c
...
...
@@ -103,7 +103,7 @@ module API
authorize_manage_builds!
build
=
get_build
(
params
[
:build_id
])
return
not_found!
(
build
)
unless
build
&&
build
.
retryable?
return
forbidden!
(
'Build is not retryable'
)
unless
build
&&
build
.
retryable?
build
=
Ci
::
Build
.
retry
(
build
)
...
...
spec/requests/api/builds_spec.rb
View file @
4eb27d7c
...
...
@@ -50,7 +50,7 @@ describe API::API, api: true do
context
'authorized user'
do
it
'should return project builds for specific commit'
do
project
.
ensure_ci_commit
(
commit
.
sha
)
get
api
(
"/projects/
#{
project
.
id
}
/builds/commit/
#{
project
.
ci_commits
.
firs
t
.
sha
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/builds/commit/
#{
commi
t
.
sha
}
"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
...
...
@@ -60,7 +60,7 @@ describe API::API, api: true do
context
'unauthorized user'
do
it
'should not return project builds'
do
project
.
ensure_ci_commit
(
commit
.
sha
)
get
api
(
"/projects/
#{
project
.
id
}
/builds/commit/
#{
project
.
ci_commits
.
firs
t
.
sha
}
"
)
get
api
(
"/projects/
#{
project
.
id
}
/builds/commit/
#{
commi
t
.
sha
}
"
)
expect
(
response
.
status
).
to
eq
(
401
)
end
...
...
@@ -99,7 +99,7 @@ describe API::API, api: true do
end
end
describe
'
GE
T /projects/:id/builds/:build_id/cancel'
do
describe
'
POS
T /projects/:id/builds/:build_id/cancel'
do
context
'authorized user'
do
context
'user with :manage_builds persmission'
do
it
'should cancel running or pending build'
do
...
...
@@ -128,7 +128,7 @@ describe API::API, api: true do
end
end
describe
'
GE
T /projects/:id/builds/:build_id/retry'
do
describe
'
POS
T /projects/:id/builds/:build_id/retry'
do
context
'authorized user'
do
context
'user with :manage_builds persmission'
do
it
'should retry non-running build'
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