Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Last active July 5, 2020 07:20
Show Gist options
  • Save jsdecena/40240385e40940dee9918a7a37b3d87d to your computer and use it in GitHub Desktop.
Save jsdecena/40240385e40940dee9918a7a37b3d87d to your computer and use it in GitHub Desktop.
User create spec
'use strict'
const User = make('App/Models/User')
const { test } = use('Test/Suite')('User unit test')
test('it can make a user', async ({ assert }) => {
const data = {
username: 'johndoe',
email: '[email protected]',
password: 'secret123'
}
const user = await User.create(data)
assert.equal(data.username, user.username)
assert.equal(data.email, user.email)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment