|
@@ -55,6 +55,17 @@ describe('Category', () => {
|
|
|
res.should.have.status(200)
|
|
|
res.body.should.have.property('name', 'category')
|
|
|
})
|
|
|
+ it('should have an "underscored" value field', async () => {
|
|
|
+ let res = await agent
|
|
|
+ .post('/api/v1/category')
|
|
|
+ .set('content-type', 'application/json')
|
|
|
+ .send({ name: ' another category here ' })
|
|
|
+
|
|
|
+ res.should.be.json
|
|
|
+ res.should.have.status(200)
|
|
|
+ res.body.should.have.property('name', ' another category here ')
|
|
|
+ res.body.should.have.property('value', 'ANOTHER_CATEGORY_HERE')
|
|
|
+ })
|
|
|
it('should return an error if category already exists', async () => {
|
|
|
try {
|
|
|
let res = await agent
|