From b2bcabb71e273a2b655d71a89a9a4b5378b73450 Mon Sep 17 00:00:00 2001 From: typicode Date: Wed, 7 Dec 2016 09:39:44 +0100 Subject: [PATCH] Fix PATCH test --- test/server/plural.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/server/plural.js b/test/server/plural.js index 6408796..9a0918b 100644 --- a/test/server/plural.js +++ b/test/server/plural.js @@ -584,17 +584,19 @@ describe('Server', () => { describe('PATCH /:resource/:id', () => { it('should respond with json and update resource', (done) => { + var partial = {body: 'bar'} + var post = {id: 1, body: 'bar'} request(server) .patch('/posts/1') - .send({body: 'bar'}) + .send(partial) .expect('Content-Type', /json/) - .expect({id: 1, body: 'bar'}) + .expect(post) .expect(200) .end((err, res) => { if (err) return done(err) assert.deepStrictEqual(res.body, post) // assert it was created in database too - assert.deepStrictEqual(db.posts[0], {id: 1, body: 'bar'}) + assert.deepStrictEqual(db.posts[0], post) done() }) })