Created
September 13, 2017 19:56
-
-
Save marshallswain/3c228a3daa7aa2a2cb10a4322e22ff00 to your computer and use it in GitHub Desktop.
Simple user create test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('create', function () { | |
before(function () { | |
return utils.services.users.removeByEmail(app, '[email protected]') | |
}) | |
it('allows user signup', function (done) { | |
const newUser = { | |
email: '[email protected]', | |
password: 'test' | |
} | |
serviceOnClient.create(newUser) | |
.then(user => { | |
const allowedProps = [ | |
'__v', | |
'_id', | |
'canPublishTo', | |
'createdAt', | |
'email', | |
'isAllowed', | |
'isVerified', | |
'roles', | |
'updatedAt' | |
] | |
Object.keys(user).forEach(prop => { | |
assert(allowedProps.includes(prop), `the ${prop} attribute was in the response`) | |
}) | |
done() | |
}) | |
.catch(done) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment