diff options
author | Mark Fletcher <mark@gitlab.com> | 2017-06-02 06:41:47 +0300 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2017-06-06 15:16:41 +0300 |
commit | 3c15f0eae757817b4d852be6b62abd3d73186d35 (patch) | |
tree | 04f56d1dd413f4c5b518086873be741e05d0c212 /spec/requests/api | |
parent | ad3e180ed3d99494414cb1b367f6b4e40ec28b87 (diff) |
Accept a username for User-level Events API
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/events_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/events_spec.rb b/spec/requests/api/events_spec.rb index 51e72c39a30..a19870a95e8 100644 --- a/spec/requests/api/events_spec.rb +++ b/spec/requests/api/events_spec.rb @@ -41,6 +41,15 @@ describe API::Events, api: true do end context "as a user that can see the event's project" do + it 'accepts a username' do + get api("/users/#{user.username}/events", user) + + expect(response).to have_http_status(200) + expect(response).to include_pagination_headers + expect(json_response).to be_an Array + expect(json_response.size).to eq(1) + end + it 'returns the events' do get api("/users/#{user.id}/events", user) |