Skip to content

Instantly share code, notes, and snippets.

@marshallswain
Created September 13, 2017 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallswain/3c228a3daa7aa2a2cb10a4322e22ff00 to your computer and use it in GitHub Desktop.
Save marshallswain/3c228a3daa7aa2a2cb10a4322e22ff00 to your computer and use it in GitHub Desktop.
Simple user create test
describe('create', function () {
before(function () {
return utils.services.users.removeByEmail(app, 'test@test.com')
})
it('allows user signup', function (done) {
const newUser = {
email: 'test@test.com',
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