mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added tests for null values in content/excerpt helpers
refs #10612
- Added test coverage for existing implementation in excerpt helper and new changes in content helper (9a21bea
)
This commit is contained in:
parent
56deccb74d
commit
04857e8823
2 changed files with 19 additions and 0 deletions
|
@ -4,6 +4,14 @@ var should = require('should'),
|
|||
helpers = require('../../../server/helpers');
|
||||
|
||||
describe('{{content}} helper', function () {
|
||||
it('renders empty string when null', function () {
|
||||
var html = null,
|
||||
rendered = helpers.content.call({html: html});
|
||||
|
||||
should.exist(rendered);
|
||||
rendered.string.should.equal('');
|
||||
});
|
||||
|
||||
it('can render content', function () {
|
||||
var html = 'Hello World',
|
||||
rendered = helpers.content.call({html: html});
|
||||
|
|
|
@ -4,6 +4,17 @@ var should = require('should'),
|
|||
helpers = require('../../../server/helpers');
|
||||
|
||||
describe('{{excerpt}} Helper', function () {
|
||||
it('renders empty string when html and excerpt are null', function () {
|
||||
var html = null,
|
||||
rendered = helpers.excerpt.call({
|
||||
html: html,
|
||||
custom_excerpt: null
|
||||
});
|
||||
|
||||
should.exist(rendered);
|
||||
rendered.string.should.equal('');
|
||||
});
|
||||
|
||||
it('can render excerpt', function () {
|
||||
var html = 'Hello World',
|
||||
rendered = helpers.excerpt.call({
|
||||
|
|
Loading…
Add table
Reference in a new issue