Skip to content
Permalink
f19a00536c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (22 sloc) 664 Bytes
const request = require('supertest')
const app = require('../app')
describe('Post new user', () => {
it('should create a new user', async () => {
const res = await request(app.callback())
.post('/api/v1/users')
.send({
username: 'unique_11223',
password: 'password',
email: 'unique2_email@example.com'
})
expect(res.statusCode).toEqual(201)
expect(res.body).toHaveProperty('created', true)
})
});
describe('Get all users', () => {
it('should show all users', async () => {
const res = await request(app.callback())
.get('/api/v1/users')
expect(res.statusCode).toEqual(200)
})
});