Start moving db code to use BoxError as well
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
|
||||
var async = require('async'),
|
||||
authcodedb = require('../authcodedb.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
database = require('../database'),
|
||||
DatabaseError = require('../databaseerror.js'),
|
||||
expect = require('expect.js'),
|
||||
hat = require('../hat.js'),
|
||||
janitor = require('../janitor.js'),
|
||||
@@ -80,8 +80,8 @@ describe('janitor', function () {
|
||||
|
||||
it('did remove expired authcode', function (done) {
|
||||
authcodedb.get(AUTHCODE_1.authCode, function (error, result) {
|
||||
expect(error).to.be.a(DatabaseError);
|
||||
expect(error.reason).to.be(DatabaseError.NOT_FOUND);
|
||||
expect(error).to.be.a(BoxError);
|
||||
expect(error.reason).to.be(BoxError.NOT_FOUND);
|
||||
expect(result).to.not.be.ok();
|
||||
done();
|
||||
});
|
||||
@@ -97,8 +97,8 @@ describe('janitor', function () {
|
||||
|
||||
it('did remove the non-expired token', function (done) {
|
||||
tokendb.getByAccessToken(TOKEN_1.accessToken, function (error, result) {
|
||||
expect(error).to.be.a(DatabaseError);
|
||||
expect(error.reason).to.be(DatabaseError.NOT_FOUND);
|
||||
expect(error).to.be.a(BoxError);
|
||||
expect(error.reason).to.be(BoxError.NOT_FOUND);
|
||||
expect(result).to.not.be.ok();
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user