backups: query using identifier instead of type
this allows us to move the enums into backups.js instead of backupdb.js
This commit is contained in:
@@ -9,6 +9,7 @@ var appdb = require('../appdb.js'),
|
||||
apps = require('../apps.js'),
|
||||
async = require('async'),
|
||||
backupdb = require('../backupdb.js'),
|
||||
backups = require('../backups.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
database = require('../database'),
|
||||
domaindb = require('../domaindb'),
|
||||
@@ -1326,7 +1327,7 @@ describe('database', function () {
|
||||
id: 'backup-box',
|
||||
encryptionVersion: 2,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_BOX,
|
||||
type: backups.BACKUP_TYPE__BOX,
|
||||
identifier: 'box',
|
||||
dependsOn: [ 'dep1' ],
|
||||
manifest: null,
|
||||
@@ -1344,7 +1345,7 @@ describe('database', function () {
|
||||
expect(error).to.be(null);
|
||||
expect(result.encryptionVersion).to.be(2);
|
||||
expect(result.packageVersion).to.be('1.0.0');
|
||||
expect(result.type).to.be(backupdb.BACKUP_TYPE_BOX);
|
||||
expect(result.type).to.be(backups.BACKUP_TYPE__BOX);
|
||||
expect(result.creationTime).to.be.a(Date);
|
||||
expect(result.dependsOn).to.eql(['dep1']);
|
||||
expect(result.manifest).to.eql(null);
|
||||
@@ -1362,7 +1363,7 @@ describe('database', function () {
|
||||
});
|
||||
|
||||
it('getByTypePaged succeeds', function (done) {
|
||||
backupdb.getByTypePaged(backupdb.BACKUP_TYPE_BOX, 1, 5, function (error, results) {
|
||||
backupdb.getByTypePaged(backups.BACKUP_TYPE__BOX, 1, 5, function (error, results) {
|
||||
expect(error).to.be(null);
|
||||
expect(results).to.be.an(Array);
|
||||
expect(results.length).to.be(1);
|
||||
@@ -1396,7 +1397,7 @@ describe('database', function () {
|
||||
id: 'app_appid_123',
|
||||
encryptionVersion: null,
|
||||
packageVersion: '1.0.0',
|
||||
type: backupdb.BACKUP_TYPE_APP,
|
||||
type: backups.BACKUP_TYPE__APP,
|
||||
identifier: 'appid',
|
||||
dependsOn: [ ],
|
||||
manifest: { foo: 'bar' },
|
||||
@@ -1414,7 +1415,7 @@ describe('database', function () {
|
||||
expect(error).to.be(null);
|
||||
expect(result.encryptionVersion).to.be(null);
|
||||
expect(result.packageVersion).to.be('1.0.0');
|
||||
expect(result.type).to.be(backupdb.BACKUP_TYPE_APP);
|
||||
expect(result.type).to.be(backups.BACKUP_TYPE__APP);
|
||||
expect(result.creationTime).to.be.a(Date);
|
||||
expect(result.dependsOn).to.eql([]);
|
||||
expect(result.manifest).to.eql({ foo: 'bar' });
|
||||
|
||||
Reference in New Issue
Block a user