merge appdb.js into apps.js
This commit is contained in:
@@ -6,13 +6,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const appdb = require('../appdb.js'),
|
||||
const apps = require('../apps.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
common = require('./common.js'),
|
||||
domains = require('../domains.js'),
|
||||
expect = require('expect.js'),
|
||||
safe = require('safetydance'),
|
||||
util = require('util');
|
||||
safe = require('safetydance');
|
||||
|
||||
describe('Domains', function () {
|
||||
const { setup, cleanup, domain, app, auditSource } = common;
|
||||
@@ -105,13 +104,13 @@ describe('Domains', function () {
|
||||
it('cannot delete referenced domain', async function () {
|
||||
const appCopy = Object.assign({}, app, { id: 'into', location: 'xx', domain: DOMAIN_0.domain, portBindings: {} });
|
||||
|
||||
await util.promisify(appdb.add)(appCopy.id, appCopy.appStoreId, appCopy.manifest, appCopy.location, appCopy.domain, appCopy.portBindings, appCopy);
|
||||
await apps.add(appCopy.id, appCopy.appStoreId, appCopy.manifest, appCopy.location, appCopy.domain, appCopy.portBindings, appCopy);
|
||||
|
||||
const [error] = await safe(domains.del(DOMAIN_0.domain, auditSource));
|
||||
expect(error.reason).to.equal(BoxError.CONFLICT);
|
||||
expect(error.message).to.contain('Domain is in use by one or more app');
|
||||
|
||||
await util.promisify(appdb.del)(appCopy.id);
|
||||
await apps.del(appCopy.id);
|
||||
});
|
||||
|
||||
it('can delete existing domain', async function () {
|
||||
|
||||
Reference in New Issue
Block a user