fix(test): working test with 0 userId

This commit is contained in:
Samuel Reed 2017-12-07 10:10:35 -06:00
parent b362776e73
commit 2bfd67ccaa
No known key found for this signature in database
GPG Key ID: 011E698EE329F38B
1 changed files with 11 additions and 2 deletions

View File

@ -364,9 +364,18 @@ describe('role model', function() {
});
});
it('should be properly authenticated with 0 userId', function(done) {
it.only('should be properly authenticated with 0 userId', function(done) {
var userData = {name: 'Raymond', email: 'x@y.com', password: 'foobar', id: 0};
User.create(userData, function(err, user) {
var TestUser = app.registry.createModel({
name: 'TestUser',
base: 'User',
// forceId is set to false so we can create a user with a known ID,
// in this case 0 - which used to fail the falsy checks.
forceId: false,
});
app.model(TestUser, {dataSource: 'db'});
TestUser.create(userData, function(err, user) {
if (err) return done(err);
Role.create({name: 'userRole'}, function(err, role) {
if (err) return done(err);