diff options
author | Himanshu Kapoor <hkapoor@gitlab.com> | 2019-08-14 15:25:40 +0530 |
---|---|---|
committer | Himanshu Kapoor <hkapoor@gitlab.com> | 2019-08-19 14:22:46 +0530 |
commit | cf88f9dda13d15ab7f773f57c6e844691fd1a496 (patch) | |
tree | 1db4a78ead3c585799bde1df976f286e21111682 /spec/frontend | |
parent | f7f91e84f71afa6bcf8a22ed181ce719bfbaf35c (diff) | |
download | gitlab-ce-cf88f9dda13d15ab7f773f57c6e844691fd1a496.tar.gz |
Add new API method: projectUsersee-2502-refactor-ee-app-assets-javascripts-approvals-components-approvers_select-vue-to-remove-approverusers
The new API method projectUsers gets all the users
added to a particular project.
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/api_spec.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js index 7004373be0e..62ba0d36982 100644 --- a/spec/frontend/api_spec.js +++ b/spec/frontend/api_spec.js @@ -151,6 +151,28 @@ describe('Api', () => { }); }); + describe('projectUsers', () => { + it('fetches all users of a particular project', done => { + const query = 'dummy query'; + const options = { unused: 'option' }; + const projectPath = 'gitlab-org%2Fgitlab-ce'; + const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/users`; + mock.onGet(expectedUrl).reply(200, [ + { + name: 'test', + }, + ]); + + Api.projectUsers('gitlab-org/gitlab-ce', query, options) + .then(response => { + expect(response.length).toBe(1); + expect(response[0].name).toBe('test'); + }) + .then(done) + .catch(done.fail); + }); + }); + describe('projectMergeRequests', () => { const projectPath = 'abc'; const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/merge_requests`; |