Last active
July 5, 2020 07:20
-
-
Save jsdecena/40240385e40940dee9918a7a37b3d87d to your computer and use it in GitHub Desktop.
User create spec
This file contains hidden or 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
'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