Make q and other query parameters not mutually exclusive

This commit is contained in:
Typicode
2015-07-17 02:39:21 +02:00
parent 29469cc21f
commit 3056b963cb
2 changed files with 47 additions and 42 deletions

View File

@ -25,11 +25,11 @@ describe('Server', function () {
]
db.comments = [
{id: 1, published: true, postId: 1},
{id: 2, published: false, postId: 1},
{id: 3, published: false, postId: 2},
{id: 4, published: false, postId: 2},
{id: 5, published: false, postId: 2}
{id: 1, body: 'foo', published: true, postId: 1},
{id: 2, body: 'bar', published: false, postId: 1},
{id: 3, body: 'baz', published: false, postId: 2},
{id: 4, body: 'qux', published: true, postId: 2},
{id: 5, body: 'quux', published: false, postId: 2}
]
db.refs = [
@ -122,6 +122,14 @@ describe('Server', function () {
.expect([])
.expect(200, done)
})
it('should support other query parameters', function (done) {
request(server)
.get('/comments?q=qu&published=true')
.expect('Content-Type', /json/)
.expect([db.comments[3]])
.expect(200, done)
})
})
describe('GET /:resource?_end=', function () {