Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial get group tests #6563

Merged
merged 3 commits into from
Jan 24, 2016

Conversation

TheHollidayInn
Copy link
Contributor

Most of the get group tests from V2 transferred. I removed some member tests, cleaned up some others, and added the new generating chat functions.

This is part of #6509.

@TheHollidayInn
Copy link
Contributor Author

Okay, I just pushed a fix for a failing chat tests, because in this PR I removed the ability to view flags for a non-admin. I am going to work on converting the chat tests to await/async and adding the remaining tests after this, so I didn't make too many adjustments to the chat in this PR.

@@ -152,6 +152,13 @@ api.getGroup = {
let group = await Group.getGroup({user, groupId: req.params.groupId, populateLeader: true});
if (!group) throw new NotFound(res.t('groupNotFound'));

if (!user.contributor.admin) {
_.remove(group.chat, function removeChat (chat) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheHollidayInn here you probably want to convert the group to a plain object with group.toJSON before removing flags information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will that help with?

@TheHollidayInn
Copy link
Contributor Author

Updated!

paglias added a commit that referenced this pull request Jan 24, 2016
@paglias paglias merged commit c5d731a into HabitRPG:api-v3-groups Jan 24, 2016
@TheHollidayInn TheHollidayInn deleted the api-v3-get-group-tests branch January 24, 2016 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants