mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Fix test
This commit is contained in:
@@ -46,15 +46,21 @@ describe('Invite to Group Controller', function() {
|
|||||||
describe('inviteNewUsers', function() {
|
describe('inviteNewUsers', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
scope.group = specHelper.newGroup({
|
scope.group = specHelper.newGroup({
|
||||||
|
type: 'party',
|
||||||
$save: sinon.stub().returns({
|
$save: sinon.stub().returns({
|
||||||
then: function(cb) { cb(); }
|
then: function(cb) { cb(); }
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
sandbox.stub(groups.Group, 'invite');
|
sandbox.stub(groups.Group, 'invite');
|
||||||
});
|
});
|
||||||
|
|
||||||
context('pre-invite', function() {
|
context('if the party does not already exist', function() {
|
||||||
it('saves the group', function() {
|
beforeEach(function() {
|
||||||
|
delete scope.group._id;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('saves the group if a new group is being created', function() {
|
||||||
scope.inviteNewUsers('uuid');
|
scope.inviteNewUsers('uuid');
|
||||||
expect(scope.group.$save).to.be.calledOnce;
|
expect(scope.group.$save).to.be.calledOnce;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user