Support OR in lists

This commit is contained in:
Typicode
2015-09-03 00:22:11 +02:00
parent f731f014f7
commit 9fc0ef5bce
5 changed files with 59 additions and 26 deletions

View File

@ -95,6 +95,14 @@ describe('Server', function () {
.expect(200, done)
})
it('should support multiple filters', function (done) {
request(server)
.get('/comments?id=1&id=2')
.expect('Content-Type', /json/)
.expect([db.comments[0], db.comments[1]])
.expect(200, done)
})
it('should support deep filter', function (done) {
request(server)
.get('/deep?a.b=1')
@ -102,6 +110,14 @@ describe('Server', function () {
.expect([db.deep[0]])
.expect(200, done)
})
it('should ignore JSONP query parameters callback and _ ', function (done) {
request(server)
.get('/comments?callback=1&_=1')
.expect('Content-Type', /text/)
.expect(new RegExp(db.comments[0].body)) // JSONP returns text
.expect(200, done)
})
})
describe('GET /:resource?q=', function () {