Skip to content

Commit 31f8a23

Browse files
committed
User resgister test was fixed. The user wthe user were created through the factory before access the register endpoint, the factory access was removed
1 parent b806736 commit 31f8a23

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/functional/registeruser.spec.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ test('it should be able to register user to the database', async ({
1010
assert,
1111
client,
1212
}) => {
13-
const sessionPayload = {
13+
const user = {
1414
username: 'JohnDoe',
1515
name: 'John Doe',
1616
1717
password: '123456',
1818
}
1919

20-
await Factory.model('App/Models/User').create(sessionPayload)
21-
2220
const response = await client
2321
.post('/register')
24-
.send(sessionPayload)
22+
.send(user)
2523
.end()
2624

2725
response.assertStatus(201)
28-
assert.exists(response)
26+
assert.exists(user)
2927
})

0 commit comments

Comments
 (0)