Commit 96bbc145 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Change commit builds URL in builds API

parent 4eb27d7c
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment