summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-11-30 18:02:58 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-01 11:10:46 +0100
commit79d99d470faf5cf088a0b76ae6bb2ec280c4c4a8 (patch)
treef71b47e33dd38cad6f536101ca522a2946a87aec /spec/requests
parentc2be86b50f50d7bd5ec36b2893aa20d85dc3d21c (diff)
downloadgitlab-ce-79d99d470faf5cf088a0b76ae6bb2ec280c4c4a8.tar.gz
API: Expose committer details for a commitapi-expose-commiter-details
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/commits_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index a6e8550fac3..314a157b7a0 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -18,11 +18,14 @@ describe API::API, api: true do
before { project.team << [user2, :reporter] }
it "returns project commits" do
+ commit = project.repository.commit
get api("/projects/#{project.id}/repository/commits", user)
- expect(response).to have_http_status(200)
+ expect(response).to have_http_status(200)
expect(json_response).to be_an Array
- expect(json_response.first['id']).to eq(project.repository.commit.id)
+ expect(json_response.first['id']).to eq(commit.id)
+ expect(json_response.first['committer_name']).to eq(commit.committer_name)
+ expect(json_response.first['committer_email']).to eq(commit.committer_email)
end
end
@@ -134,6 +137,8 @@ describe API::API, api: true do
expect(response).to have_http_status(201)
expect(json_response['title']).to eq(message)
+ expect(json_response['committer_name']).to eq(user.name)
+ expect(json_response['committer_email']).to eq(user.email)
end
it 'returns a 400 bad request if file exists' do