mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
af4bfb8862
- purely for cleanliness! - we use kebabcase by default - tests should be kebab-case-file_spec.js (one day we want this to be .test.js)
31 lines
817 B
JavaScript
31 lines
817 B
JavaScript
const should = require('should');
|
|
const sinon = require('sinon');
|
|
const routing = require('../../../core/frontend/services/routing');
|
|
const 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();
|
|
});
|
|
});
|