Merge pull request #3161 from strongloop/fix/role-properties
Add missing type to Role properties definition
This commit is contained in:
commit
bb939bec07
|
@ -12,11 +12,12 @@
|
|||
"required": true
|
||||
},
|
||||
"description": "string",
|
||||
|
||||
"created": {
|
||||
"type":"date",
|
||||
"defaultFn": "now"
|
||||
},
|
||||
"modified": {
|
||||
"type":"date",
|
||||
"defaultFn": "now"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -96,6 +96,14 @@ describe('role model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should generate created/modified properties', () => {
|
||||
return Role.create({name: 'ADMIN'})
|
||||
.then(role => {
|
||||
expect(role.toJSON().created).to.be.instanceOf(Date);
|
||||
expect(role.toJSON().modified).to.be.instanceOf(Date);
|
||||
});
|
||||
});
|
||||
|
||||
it('should define role/user relations', function(done) {
|
||||
User.create({name: 'Raymond', email: 'x@y.com', password: 'foobar'}, function(err, user) {
|
||||
if (err) return done(err);
|
||||
|
|
Loading…
Reference in New Issue