diff --git a/__tests__/app.test.js b/__tests__/app.test.js index b139d6d..0b55513 100644 --- a/__tests__/app.test.js +++ b/__tests__/app.test.js @@ -8,20 +8,19 @@ describe('horses routes', () => { return setup(pool); }); it('should return a list of horses', async () => { - const res = await request(app).get('/Horses'); - const expected = horses.map((horse) => { - return { id: horse.id, name: horse.name }; - }); - expect(res.body).toEqual(expected); + const resp = await request(app).get('/Horses'); + expect(resp.body.length).toEqual(5); + expect(resp.body.length).toEqual(5); }); + it('/horses/:id should return hoses detail', async () => { const res = await request(app).get('/horses/1'); const lucky = { id: '1', name: 'Lucky', - wins: '13', - born: '2012', + wins: 13, + born: 2012, }; expect(res.body).toEqual(lucky); }); diff --git a/lib/public/index.html b/lib/public/index.html index bf3a942..e61e3f8 100644 --- a/lib/public/index.html +++ b/lib/public/index.html @@ -29,7 +29,7 @@

HORSES API

GET Gets a list of horses' names and ids - List Horses @@ -41,7 +41,7 @@

HORSES API

Returns the detail about the horse matching the id in the parameter - Get Horse 1