Skip to content

Commit

Permalink
Merge pull request strongloop#3161 from strongloop/fix/role-properties
Browse files Browse the repository at this point in the history
Add missing type to Role properties definition
  • Loading branch information
bajtos authored Jan 30, 2017
2 parents 5fd79b1 + c072d06 commit bb939be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/models/role.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"required": true
},
"description": "string",

"created": {
"type":"date",
"defaultFn": "now"
},
"modified": {
"type":"date",
"defaultFn": "now"
}
},
Expand Down
8 changes: 8 additions & 0 deletions test/role.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '[email protected]', password: 'foobar'}, function(err, user) {
if (err) return done(err);
Expand Down

0 comments on commit bb939be

Please sign in to comment.