From 67d088262c6716dc24b97a8187b5b0132c1f217b Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Fri, 9 Oct 2015 15:54:05 -0700 Subject: [PATCH] :bug:Fix user admin query tests --- test/server/functional/user.spec.coffee | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/test/server/functional/user.spec.coffee b/test/server/functional/user.spec.coffee index 4c6b33383..7868b0270 100644 --- a/test/server/functional/user.spec.coffee +++ b/test/server/functional/user.spec.coffee @@ -269,20 +269,10 @@ describe 'GET /db/user', -> expect(body.type).toBeDefined() done() - it 'is able to do a sweet query', (done) -> - conditions = [ - ['limit', 20] - ['where', 'email'] - ['equals', 'admin@afc.com'] - ['sort', '-dateCreated'] - ] + it 'is able to do a semi-sweet query', (done) -> options = { - url: getURL(urlUser) - qs: { - conditions: JSON.stringify(conditions) - } + url: getURL(urlUser) + "?conditions[limit]=20&conditions[sort]=-dateCreated" } - req = request.get(options, (error, response) -> expect(response.statusCode).toBe(200) res = JSON.parse(response.body) @@ -291,14 +281,8 @@ describe 'GET /db/user', -> ) it 'rejects bad conditions', (done) -> - conditions = [ - ['lime', 20] - ] options = { - url: getURL(urlUser) - qs: { - conditions: JSON.stringify(conditions) - } + url: getURL(urlUser) + "?conditions[lime]=20&conditions[sort]=-dateCreated" } req = request.get(options, (error, response) ->