Enable guild challenge prize to use guild bank gems (#7840)

* add leader property to getGroups

* Add test coverage
This commit is contained in:
Oziris
2016-08-01 16:31:31 -03:00
committed by Blade Barringer
parent a8226b2363
commit d51bd68201
3 changed files with 30 additions and 4 deletions

View File

@@ -46,7 +46,14 @@ describe('GET /challenges/:challengeId', () => {
id: groupLeader._id,
profile: {name: groupLeader.profile.name},
});
expect(chal.group).to.eql(_.pick(group, ['_id', 'id', 'name', 'type', 'privacy']));
expect(chal.group).to.eql({
_id: group._id,
id: group.id,
name: group.name,
type: group.type,
privacy: group.privacy,
leader: groupLeader.id,
});
});
});
@@ -91,7 +98,14 @@ describe('GET /challenges/:challengeId', () => {
id: groupLeader._id,
profile: {name: groupLeader.profile.name},
});
expect(chal.group).to.eql(_.pick(group, ['_id', 'id', 'name', 'type', 'privacy']));
expect(chal.group).to.eql({
_id: group._id,
id: group.id,
name: group.name,
type: group.type,
privacy: group.privacy,
leader: groupLeader.id,
});
});
});
@@ -136,7 +150,14 @@ describe('GET /challenges/:challengeId', () => {
id: groupLeader.id,
profile: {name: groupLeader.profile.name},
});
expect(chal.group).to.eql(_.pick(group, ['_id', 'id', 'name', 'type', 'privacy']));
expect(chal.group).to.eql({
_id: group._id,
id: group.id,
name: group.name,
type: group.type,
privacy: group.privacy,
leader: groupLeader.id,
});
});
});
});