mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
parent
1189bc823a
commit
f0afbc5cc0
@ -81,26 +81,22 @@ describe('Validation', function () {
|
||||
});
|
||||
|
||||
it('transforms 0 and 1', function () {
|
||||
const post = models.Post.forge(testUtils.DataGenerator.forKnex.createPost({slug: 'test', featured: 0, page: 1}));
|
||||
const post = models.Post.forge(testUtils.DataGenerator.forKnex.createPost({slug: 'test', featured: 0}));
|
||||
post.get('featured').should.eql(0);
|
||||
post.get('page').should.eql(1);
|
||||
|
||||
return validation.validateSchema('posts', post, {method: 'insert'})
|
||||
.then(function () {
|
||||
post.get('featured').should.eql(false);
|
||||
post.get('page').should.eql(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps true or false', function () {
|
||||
const post = models.Post.forge(testUtils.DataGenerator.forKnex.createPost({slug: 'test', featured: true, page: false}));
|
||||
const post = models.Post.forge(testUtils.DataGenerator.forKnex.createPost({slug: 'test', featured: true}));
|
||||
post.get('featured').should.eql(true);
|
||||
post.get('page').should.eql(false);
|
||||
|
||||
return validation.validateSchema('posts', post, {method: 'insert'})
|
||||
.then(function () {
|
||||
post.get('featured').should.eql(true);
|
||||
post.get('page').should.eql(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user