Move UsersError to BoxError
This commit is contained in:
@@ -246,7 +246,7 @@ describe('User', function () {
|
||||
users.verify(userObject.id, '', function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -256,7 +256,7 @@ describe('User', function () {
|
||||
users.verify(userObject.id, PASSWORD+PASSWORD, function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -274,7 +274,7 @@ describe('User', function () {
|
||||
it('fails for ghost if not enabled', function (done) {
|
||||
users.verify(userObject.id, 'foobar', function (error) {
|
||||
expect(error).to.be.a(UsersError);
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -288,7 +288,7 @@ describe('User', function () {
|
||||
fs.unlinkSync(constants.GHOST_USER_FILE);
|
||||
|
||||
expect(error).to.be.a(UsersError);
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -346,7 +346,7 @@ describe('User', function () {
|
||||
users.verifyWithUsername(USERNAME, '', function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -356,7 +356,7 @@ describe('User', function () {
|
||||
users.verifyWithUsername(USERNAME, PASSWORD+PASSWORD, function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -390,7 +390,7 @@ describe('User', function () {
|
||||
fs.unlinkSync(constants.GHOST_USER_FILE);
|
||||
|
||||
expect(error).to.be.a(UsersError);
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -433,7 +433,7 @@ describe('User', function () {
|
||||
users.verifyWithEmail(EMAIL, '', function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -443,7 +443,7 @@ describe('User', function () {
|
||||
users.verifyWithEmail(EMAIL, PASSWORD+PASSWORD, function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -477,7 +477,7 @@ describe('User', function () {
|
||||
fs.unlinkSync(constants.GHOST_USER_FILE);
|
||||
|
||||
expect(error).to.be.a(UsersError);
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -804,7 +804,7 @@ describe('User', function () {
|
||||
users.verify(userObject.id, PASSWORD, function (error, result) {
|
||||
expect(error).to.be.ok();
|
||||
expect(result).to.not.be.ok();
|
||||
expect(error.reason).to.equal(UsersError.WRONG_PASSWORD);
|
||||
expect(error.reason).to.equal(UsersError.INVALID_CREDENTIALS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user