We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84493e0 commit b2bcabbCopy full SHA for b2bcabb
test/server/plural.js
@@ -584,17 +584,19 @@ describe('Server', () => {
584
585
describe('PATCH /:resource/:id', () => {
586
it('should respond with json and update resource', (done) => {
587
+ var partial = {body: 'bar'}
588
+ var post = {id: 1, body: 'bar'}
589
request(server)
590
.patch('/posts/1')
- .send({body: 'bar'})
591
+ .send(partial)
592
.expect('Content-Type', /json/)
- .expect({id: 1, body: 'bar'})
593
+ .expect(post)
594
.expect(200)
595
.end((err, res) => {
596
if (err) return done(err)
597
assert.deepStrictEqual(res.body, post)
598
// assert it was created in database too
- assert.deepStrictEqual(db.posts[0], {id: 1, body: 'bar'})
599
+ assert.deepStrictEqual(db.posts[0], post)
600
done()
601
})
602
0 commit comments