From c141ee6d1cb054c72c76590369f9361fcdc0048f Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 5 Sep 2015 08:14:55 -0500 Subject: [PATCH] Fix test --- test/spec/controllers/inviteToGroupCtrlSpec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/spec/controllers/inviteToGroupCtrlSpec.js b/test/spec/controllers/inviteToGroupCtrlSpec.js index fef3382564..91d251dc58 100644 --- a/test/spec/controllers/inviteToGroupCtrlSpec.js +++ b/test/spec/controllers/inviteToGroupCtrlSpec.js @@ -46,15 +46,21 @@ describe('Invite to Group Controller', function() { describe('inviteNewUsers', function() { beforeEach(function() { scope.group = specHelper.newGroup({ + type: 'party', $save: sinon.stub().returns({ then: function(cb) { cb(); } }) }); + sandbox.stub(groups.Group, 'invite'); }); - context('pre-invite', function() { - it('saves the group', function() { + context('if the party does not already exist', function() { + beforeEach(function() { + delete scope.group._id; + }); + + it('saves the group if a new group is being created', function() { scope.inviteNewUsers('uuid'); expect(scope.group.$save).to.be.calledOnce; });