mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
7f1d3ebc07
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
31 lines
817 B
JavaScript
31 lines
817 B
JavaScript
const should = require('should'),
|
|
sinon = require('sinon'),
|
|
routing = require('../../../../core/frontend/services/routing'),
|
|
getRssUrl = require('../../../../core/frontend/meta/rss_url');
|
|
|
|
describe('getRssUrl', function () {
|
|
beforeEach(function () {
|
|
sinon.stub(routing.registry, 'getRssUrl').returns('/rss/');
|
|
});
|
|
|
|
afterEach(function () {
|
|
sinon.restore();
|
|
});
|
|
|
|
it('should return rss url', function () {
|
|
const rssUrl = getRssUrl({
|
|
secure: false
|
|
});
|
|
|
|
should.equal(rssUrl, '/rss/');
|
|
});
|
|
|
|
it('forwards absolute/secure flags', function () {
|
|
const rssUrl = getRssUrl({
|
|
secure: false
|
|
}, true);
|
|
|
|
routing.registry.getRssUrl.calledWith({secure: false, absolute: true}).should.be.true();
|
|
});
|
|
});
|