LOCATION_TYPE can move into location.js
This commit is contained in:
@@ -10,6 +10,7 @@ const apps = require('../apps.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
common = require('./common.js'),
|
||||
expect = require('expect.js'),
|
||||
Location = require('../location.js'),
|
||||
safe = require('safetydance');
|
||||
|
||||
describe('Apps', function () {
|
||||
@@ -20,17 +21,17 @@ describe('Apps', function () {
|
||||
|
||||
describe('validateLocations', function () {
|
||||
it('does not allow reserved subdomain', async function () {
|
||||
let location = { type: apps.LOCATION_TYPE_ALIAS, subdomain: 'my', domain: domain.domain };
|
||||
let location = new Location('my', domain.domain, Location.TYPE_ALIAS);
|
||||
expect(await apps._validateLocations([location])).to.be.an(Error);
|
||||
});
|
||||
|
||||
it('does not allow unknown domain', async function () {
|
||||
let location = { type: apps.LOCATION_TYPE_PRIMARY, subdomain: 'my2', domain: domain.domain + 'x' };
|
||||
let location = new Location('my2', domain.domain + 'x', Location.TYPE_PRIMARY);
|
||||
expect(await apps._validateLocations([location])).to.be.an(Error);
|
||||
});
|
||||
|
||||
it('allows valid locations', async function () {
|
||||
let location = { type: apps.LOCATION_TYPE_SECONDARY, subdomain: 'my2', domain: domain.domain };
|
||||
let location = new Location('my2', domain.domain, Location.TYPE_SECONDARY);
|
||||
expect(await apps._validateLocations([location])).to.be(null);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user