mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Add user scrub quest data back in
This commit is contained in:
@@ -46,7 +46,8 @@ describe('Groups Controller', function() {
|
||||
completed : null,
|
||||
RSVPNeeded : false
|
||||
}
|
||||
}
|
||||
},
|
||||
markModified: sinon.spy()
|
||||
};
|
||||
|
||||
res = {
|
||||
@@ -122,6 +123,26 @@ describe('Groups Controller', function() {
|
||||
expect(group.quest.members[user._id]).to.not.exist;
|
||||
});
|
||||
|
||||
it('scrubs quest data from user', function() {
|
||||
user.party.quest.progress = {
|
||||
up: 100,
|
||||
down: 32,
|
||||
collect: {
|
||||
foo: 12,
|
||||
bar: 4
|
||||
}
|
||||
};
|
||||
|
||||
groupsController.questLeave(req, res);
|
||||
|
||||
expect(user.party.quest.key).to.not.exist;
|
||||
expect(user.party.quest.progress).to.eql({
|
||||
up: 0,
|
||||
down: 0,
|
||||
collect: {}
|
||||
});
|
||||
});
|
||||
|
||||
it('sends back 204 on success', function() {
|
||||
groupsController.questLeave(req, res);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user