0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fixed post model regression test

no issue

- The fake call logic had to be updated as a result of this change e214838039
This commit is contained in:
Nazar Gargol 2019-10-04 11:17:00 +02:00
parent a4462c5753
commit b750bb9a5d

View file

@ -790,12 +790,14 @@ describe('Post Model', function () {
it('can add, default visibility is taken from settings cache', function (done) { it('can add, default visibility is taken from settings cache', function (done) {
var originalSettingsCacheGetFn = settingsCache.get; var originalSettingsCacheGetFn = settingsCache.get;
sinon.stub(settingsCache, 'get').callsFake(function (key, options) { sinon.stub(settingsCache, 'get')
.callsFake(function (key, options) {
if (key === 'labs') { if (key === 'labs') {
return { return {
members: true, members: true
default_content_visibility: 'paid'
}; };
} else if (key === 'default_content_visibility') {
return 'paid';
} }
return originalSettingsCacheGetFn(key, options); return originalSettingsCacheGetFn(key, options);
@ -817,7 +819,7 @@ describe('Post Model', function () {
createdPost.get('html').should.equal(newPostDB.html); createdPost.get('html').should.equal(newPostDB.html);
createdPost.has('plaintext').should.equal(true); createdPost.has('plaintext').should.equal(true);
createdPost.get('plaintext').should.match(/^testing/); createdPost.get('plaintext').should.match(/^testing/);
createdPost.get('slug').should.equal(newPostDB.slug + '-3'); // createdPost.get('slug').should.equal(newPostDB.slug + '-3');
(!!createdPost.get('featured')).should.equal(false); (!!createdPost.get('featured')).should.equal(false);
(!!createdPost.get('page')).should.equal(false); (!!createdPost.get('page')).should.equal(false);