mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Correct test assertion
This commit is contained in:
@@ -207,7 +207,7 @@ describe('Groups Controller', function() {
|
|||||||
|
|
||||||
expect(group.leave).to.not.be.called;
|
expect(group.leave).to.not.be.called;
|
||||||
expect(res.json).to.be.calledOnce;
|
expect(res.json).to.be.calledOnce;
|
||||||
expect(res.json).to.be.calledWith(403, 'You cannot leave when you have started a quest. Abort the quest first.');
|
expect(res.json).to.be.calledWith(403, 'You cannot leave your party when you have started a quest. Abort the quest first.');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('leaves party if quest is not active', function() {
|
it('leaves party if quest is not active', function() {
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ api.leave = function(req, res, next) {
|
|||||||
|
|
||||||
if (group.type === 'party') {
|
if (group.type === 'party') {
|
||||||
if (group.quest && group.quest.leader === user._id) {
|
if (group.quest && group.quest.leader === user._id) {
|
||||||
return res.json(403, 'You cannot leave party when you have started a quest. Abort the quest first.');
|
return res.json(403, 'You cannot leave your party when you have started a quest. Abort the quest first.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (group.quest && group.quest.active && group.quest.members && group.quest.members[user._id]) {
|
if (group.quest && group.quest.active && group.quest.members && group.quest.members[user._id]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user