mirror of
https://github.com/strapi/strapi.git
synced 2026-01-05 03:38:09 +00:00
21 lines
529 B
JavaScript
Executable File
21 lines
529 B
JavaScript
Executable File
'use strict';
|
|
|
|
const request = require('../helpers/context').request;
|
|
|
|
describe('req.subdomains', function () {
|
|
it('should return subdomain array', function () {
|
|
const req = request();
|
|
req.header.host = 'tobi.ferrets.example.com';
|
|
req.app.subdomainOffset = 2;
|
|
req.subdomains.should.eql(['ferrets', 'tobi']);
|
|
|
|
req.app.subdomainOffset = 3;
|
|
req.subdomains.should.eql(['tobi']);
|
|
});
|
|
|
|
describe('with no host present', function () {
|
|
const req = request();
|
|
req.subdomains.should.eql([]);
|
|
});
|
|
});
|