Ghost/test/unit/data/meta/rss_url_spec.js
Hannah Wolfe 7f1d3ebc07
Move tests from core to root (#11700)
- 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>
2020-03-30 16:26:47 +01:00

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();
});
});