move logic to model code

This commit is contained in:
Girish Ramakrishnan
2016-06-02 22:25:48 -07:00
parent 13a1213b0d
commit 097d23c412
4 changed files with 44 additions and 17 deletions
+19 -1
View File
@@ -1,4 +1,3 @@
/* jslint node:true */
/* global it:false */
/* global describe:false */
/* global before:false */
@@ -678,4 +677,23 @@ describe('User', function () {
});
});
});
describe('remove', function () {
before(createOwner);
after(cleanupUsers);
it('fails for unkown user', function (done) {
user.remove('unknown', { }, function (error) {
expect(error.reason).to.be(UserError.NOT_FOUND);
done();
});
});
it('can remove valid user', function (done) {
user.remove(userObject.id, { }, function (error) {
expect(error).to.be(null);
done();
});
});
});
});