summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2015-12-29 23:12:36 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2015-12-29 23:12:36 +0100
commitd2601211a0c7a44666501dea82a8488b08f8faa7 (patch)
treea505ca3b62c77291c8d26ae32aee756273c25693 /lib
parentb2fbeb377d8ba17352d40817b0b444196cb97636 (diff)
downloadgitlab-ce-d2601211a0c7a44666501dea82a8488b08f8faa7.tar.gz
Add specs for build listings in API
Diffstat (limited to 'lib')
-rw-r--r--lib/api/builds.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/api/builds.rb b/lib/api/builds.rb
index 16e4549d280..a519224d2b8 100644
--- a/lib/api/builds.rb
+++ b/lib/api/builds.rb
@@ -27,7 +27,10 @@ module API
# Example Request:
# GET /projects/:id/builds/commit/:sha
get ':id/builds/commit/:sha' do
- builds = user_project.ci_commits.find_by_sha(params[:sha]).builds.order('id DESC')
+ commit = user_project.ci_commits.find_by_sha(params[:sha])
+ return not_found! unless commit
+
+ builds = commit.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
present paginate(builds), with: Entities::Build
end
@@ -65,7 +68,7 @@ module API
body trace
end
- # cancel a specific build of a project
+ # Cancel a specific build of a project
#
# parameters:
# id (required) - the id of a project
@@ -83,7 +86,7 @@ module API
present build, with: Entities::Build
end
- # cancel a specific build of a project
+ # Retry a specific build of a project
#
# parameters:
# id (required) - the id of a project