Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
52ad0aa1
Commit
52ad0aa1
authored
Feb 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
77d48545
fe76bb29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+7
-0
spec/javascripts/api_spec.js
spec/javascripts/api_spec.js
+16
-0
No files found.
app/assets/javascripts/api.js
View file @
52ad0aa1
...
...
@@ -5,6 +5,7 @@ import axios from './lib/utils/axios_utils';
const
Api
=
{
groupsPath
:
'
/api/:version/groups.json
'
,
groupPath
:
'
/api/:version/groups/:id
'
,
groupMembersPath
:
'
/api/:version/groups/:id/members
'
,
subgroupsPath
:
'
/api/:version/groups/:id/subgroups
'
,
namespacesPath
:
'
/api/:version/namespaces.json
'
,
groupProjectsPath
:
'
/api/:version/groups/:id/projects.json
'
,
...
...
@@ -43,6 +44,12 @@ const Api = {
});
},
groupMembers
(
id
)
{
const
url
=
Api
.
buildUrl
(
this
.
groupMembersPath
).
replace
(
'
:id
'
,
encodeURIComponent
(
id
));
return
axios
.
get
(
url
);
},
// Return groups list. Filtered by query
groups
(
query
,
options
,
callback
=
$
.
noop
)
{
const
url
=
Api
.
buildUrl
(
Api
.
groupsPath
);
...
...
spec/javascripts/api_spec.js
View file @
52ad0aa1
...
...
@@ -49,6 +49,22 @@ describe('Api', () => {
});
});
describe
(
'
groupMembers
'
,
()
=>
{
it
(
'
fetches group members
'
,
done
=>
{
const
groupId
=
'
54321
'
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/groups/
${
groupId
}
/members`
;
const
expectedData
=
[{
id
:
7
}];
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
expectedData
);
Api
.
groupMembers
(
groupId
)
.
then
(({
data
})
=>
{
expect
(
data
).
toEqual
(
expectedData
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
describe
(
'
groups
'
,
()
=>
{
it
(
'
fetches groups
'
,
done
=>
{
const
query
=
'
dummy query
'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment