mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -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>
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
var should = require('should'),
|
|
|
|
// Stuff we are testing
|
|
helpers = require('../../../core/frontend/helpers');
|
|
|
|
describe('{{post_class}} helper', function () {
|
|
it('can render class string', function () {
|
|
var rendered = helpers.post_class.call({});
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post no-image');
|
|
});
|
|
|
|
it('can render class string without no-image class', function () {
|
|
var rendered = helpers.post_class.call({feature_image: 'blah'});
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post');
|
|
});
|
|
|
|
it('can render featured class', function () {
|
|
var post = {featured: true},
|
|
rendered = helpers.post_class.call(post);
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post featured no-image');
|
|
});
|
|
|
|
it('can render featured class without no-image class', function () {
|
|
var post = {featured: true, feature_image: 'asdass'},
|
|
rendered = helpers.post_class.call(post);
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post featured');
|
|
});
|
|
|
|
it('can render page class', function () {
|
|
var post = {page: true},
|
|
rendered = helpers.post_class.call(post);
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post no-image page');
|
|
});
|
|
|
|
it('can render page class without no-image class', function () {
|
|
var post = {page: true, feature_image: 'asdasdas'},
|
|
rendered = helpers.post_class.call(post);
|
|
|
|
should.exist(rendered);
|
|
rendered.string.should.equal('post page');
|
|
});
|
|
});
|