diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-05 08:38:19 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-05 08:38:19 +0000 |
commit | b7d20f14c6008a857a16977a92bb87002683059d (patch) | |
tree | f6f502ca1059a08d85b59871f8ec2560bc08d4ae /spec/requests | |
parent | bedc66eb0407aa36127367f53f76944ebb98f5a6 (diff) | |
parent | 55f91f3d4348e1d7be0953d0ddf9984d65f18993 (diff) | |
download | gitlab-ce-b7d20f14c6008a857a16977a92bb87002683059d.tar.gz |
Merge branch 'maser/gitlab-ce-order-commit-comments-in-api' into 'master'
Order commit comments in API chronologically
When fetching commit comments via API, the comments were not ordered,
but just returned in the order Postgresql finds them. Now the API always
returns comments in chronological order.
Same as !628 but with CI
See merge request !768
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/commits_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 9ea60e1a4ad..a1c248c636e 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -9,6 +9,7 @@ describe API::API, api: true do let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) } let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) } let!(:note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'a comment on a commit') } + let!(:another_note) { create(:note_on_commit, author: user, project: project, commit_id: project.repository.commit.id, note: 'another comment on a commit') } before { project.team << [user, :reporter] } @@ -89,7 +90,7 @@ describe API::API, api: true do get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}/comments", user) expect(response.status).to eq(200) expect(json_response).to be_an Array - expect(json_response.length).to eq(1) + expect(json_response.length).to eq(2) expect(json_response.first['note']).to eq('a comment on a commit') expect(json_response.first['author']['id']).to eq(user.id) end |