Skip to content

Commit 8113f1c

Browse files
committed
test: add test
1 parent a853b7b commit 8113f1c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/server/plural.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,13 +623,22 @@ describe('Server', function () {
623623
router.db._.id = '_id'
624624
})
625625

626-
it('should be possible to override id property', function (done) {
626+
it('should be possible to GET using a different id property', function (done) {
627627
request(server)
628628
.get('/posts/1')
629629
.expect('Content-Type', /json/)
630630
.expect(router.db.getState().posts[0])
631631
.expect(200, done)
632632
})
633633

634+
it('should be possible to POST using a different id property', function (done) {
635+
request(server)
636+
.post('/posts')
637+
.send({ body: 'hello' })
638+
.expect('Content-Type', /json/)
639+
.expect({_id: 2, body: 'hello'})
640+
.expect(201, done)
641+
})
642+
634643
})
635644
})

0 commit comments

Comments
 (0)