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
96bbc145
Commit
96bbc145
authored
Jan 11, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change commit builds URL in builds API
parent
4eb27d7c
Changes
2
Hide 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
+2
-2
spec/requests/api/builds_spec.rb
spec/requests/api/builds_spec.rb
+3
-3
No files found.
lib/api/builds.rb
View file @
96bbc145
...
@@ -28,8 +28,8 @@ module API
...
@@ -28,8 +28,8 @@ module API
# scope (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled;
# scope (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled;
# if none provided showing all builds)
# if none provided showing all builds)
# Example Request:
# Example Request:
# GET /projects/:id/
builds/commit/:sha
# GET /projects/:id/
repository/commits/:sha/builds
get
':id/
builds/commit/:sha
'
do
get
':id/
repository/commits/:sha/builds
'
do
commit
=
user_project
.
ci_commits
.
find_by_sha
(
params
[
:sha
])
commit
=
user_project
.
ci_commits
.
find_by_sha
(
params
[
:sha
])
return
not_found!
unless
commit
return
not_found!
unless
commit
...
...
spec/requests/api/builds_spec.rb
View file @
96bbc145
...
@@ -46,11 +46,11 @@ describe API::API, api: true do
...
@@ -46,11 +46,11 @@ describe API::API, api: true do
end
end
end
end
describe
'GET /projects/:id/
builds/commit/:sha
'
do
describe
'GET /projects/:id/
repository/commits/:sha/builds
'
do
context
'authorized user'
do
context
'authorized user'
do
it
'should return project builds for specific commit'
do
it
'should return project builds for specific commit'
do
project
.
ensure_ci_commit
(
commit
.
sha
)
project
.
ensure_ci_commit
(
commit
.
sha
)
get
api
(
"/projects/
#{
project
.
id
}
/
builds/commit/
#{
commit
.
sha
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/
repository/commits/
#{
commit
.
sha
}
/builds
"
,
user
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
...
@@ -60,7 +60,7 @@ describe API::API, api: true do
...
@@ -60,7 +60,7 @@ describe API::API, api: true do
context
'unauthorized user'
do
context
'unauthorized user'
do
it
'should not return project builds'
do
it
'should not return project builds'
do
project
.
ensure_ci_commit
(
commit
.
sha
)
project
.
ensure_ci_commit
(
commit
.
sha
)
get
api
(
"/projects/
#{
project
.
id
}
/
builds/commit/
#{
commit
.
sha
}
"
)
get
api
(
"/projects/
#{
project
.
id
}
/
repository/commits/
#{
commit
.
sha
}
/builds
"
)
expect
(
response
.
status
).
to
eq
(
401
)
expect
(
response
.
status
).
to
eq
(
401
)
end
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