Add getOwner

This commit is contained in:
girish@cloudron.io
2016-01-13 12:28:38 -08:00
parent 5eb3c208f1
commit efaacdb534
3 changed files with 47 additions and 1 deletions

View File

@@ -106,6 +106,30 @@ describe('User', function () {
});
});
describe('getOwner', function() {
before(cleanupUsers);
after(cleanupUsers);
it('fails because there is no owner', function (done) {
user.getOwner(function (error) {
expect(error.reason).to.be(UserError.NOT_FOUND);
done();
});
});
it('succeeds', function (done) {
createUser(function (error) {
if (error) return done(error);
user.getOwner(function (error, owner) {
expect(error).to.be(null);
expect(owner.email).to.be(EMAIL);
done();
});
});
});
});
describe('verify', function () {
before(createUser);
after(cleanupUsers);