This commit is contained in:
Blade Barringer
2015-09-05 08:14:55 -05:00
parent f65ca3cf48
commit c141ee6d1c

View File

@@ -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;
}); });