mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05: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>
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
var should = require('should'),
|
|
|
|
// Stuff we are testing
|
|
helpers = require('../../../core/frontend/helpers');
|
|
|
|
describe('{{twitter_url}} helper', function () {
|
|
var options = {data: {site: {}}};
|
|
|
|
beforeEach(function () {
|
|
options.data.site = {twitter: ''};
|
|
});
|
|
|
|
it('should output the twitter url for @site, if no other twitter username is provided', function () {
|
|
options.data.site = {twitter: '@hey'};
|
|
|
|
helpers.twitter_url.call({}, options).should.equal('https://twitter.com/hey');
|
|
});
|
|
|
|
it('should output the twitter url for the local object, if it has one', function () {
|
|
options.data.site = {twitter: '@hey'};
|
|
|
|
helpers.twitter_url.call({twitter: '@youthere'}, options).should.equal('https://twitter.com/youthere');
|
|
});
|
|
|
|
it('should output the twitter url for the provided username when it is explicitly passed in', function () {
|
|
options.data.site = {twitter: '@hey'};
|
|
|
|
helpers.twitter_url.call({twitter: '@youthere'}, '@iseeyouoverthere', options)
|
|
.should.equal('https://twitter.com/iseeyouoverthere');
|
|
});
|
|
|
|
it('should return null if there are no twitter usernames', function () {
|
|
should.equal(helpers.twitter_url(options), null);
|
|
});
|
|
});
|
|
|