diff --git a/doc/api/projects.md b/doc/api/projects.md index 27436a052daa2f0413af21d9ffa3e1fb1eb15c06..f96bf7f6d63f0277b176b4e43caa229fdeb2f688 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -436,7 +436,7 @@ Parameters: ### Get project events Get the events for the specified project. -Sorted from newest to latest +Sorted from newest to oldest ``` GET /projects/:id/events diff --git a/doc/api/users.md b/doc/api/users.md index 15202010b7b8a01fb5ea0e2277e0f1b0389aaa59..a52b2d51d78118b07e2ef6daebc474ecacbf70a2 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -630,7 +630,7 @@ Will return `200 OK` on success, `404 User Not Found` is user cannot be found or ### Get user contribution events -Get the contribution events for the specified user, sorted from newest to latest. +Get the contribution events for the specified user, sorted from newest to oldest. ``` GET /users/:id/events diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 56b2ec6271e6a0de1c89e3714743af399cff1933..91e54af1209bbb9bbe5c27356d547aa4108c88c1 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -898,7 +898,6 @@ describe API::API, api: true do describe 'GET /user/:id/events' do let(:user) { create(:user) } - let(:lambda_user) { create(:user) } let(:project) { create(:empty_project) } let(:note) { create(:note_on_issue, note: 'What an awesome day!', project: project) } @@ -909,7 +908,9 @@ describe API::API, api: true do context "as a user than cannot see the event's project" do it 'returns no events' do - get api("/users/#{user.id}/events", lambda_user) + other_user = create(:user) + + get api("/users/#{user.id}/events", other_user) expect(response).to have_http_status(200) expect(json_response).to be_empty