mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-11 16:21:08 -05:00
🐛Fix user admin query tests
This commit is contained in:
parent
8fce82ce72
commit
67d088262c
1 changed files with 3 additions and 19 deletions
|
@ -269,20 +269,10 @@ describe 'GET /db/user', ->
|
||||||
expect(body.type).toBeDefined()
|
expect(body.type).toBeDefined()
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it 'is able to do a sweet query', (done) ->
|
it 'is able to do a semi-sweet query', (done) ->
|
||||||
conditions = [
|
|
||||||
['limit', 20]
|
|
||||||
['where', 'email']
|
|
||||||
['equals', 'admin@afc.com']
|
|
||||||
['sort', '-dateCreated']
|
|
||||||
]
|
|
||||||
options = {
|
options = {
|
||||||
url: getURL(urlUser)
|
url: getURL(urlUser) + "?conditions[limit]=20&conditions[sort]=-dateCreated"
|
||||||
qs: {
|
|
||||||
conditions: JSON.stringify(conditions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
req = request.get(options, (error, response) ->
|
req = request.get(options, (error, response) ->
|
||||||
expect(response.statusCode).toBe(200)
|
expect(response.statusCode).toBe(200)
|
||||||
res = JSON.parse(response.body)
|
res = JSON.parse(response.body)
|
||||||
|
@ -291,14 +281,8 @@ describe 'GET /db/user', ->
|
||||||
)
|
)
|
||||||
|
|
||||||
it 'rejects bad conditions', (done) ->
|
it 'rejects bad conditions', (done) ->
|
||||||
conditions = [
|
|
||||||
['lime', 20]
|
|
||||||
]
|
|
||||||
options = {
|
options = {
|
||||||
url: getURL(urlUser)
|
url: getURL(urlUser) + "?conditions[lime]=20&conditions[sort]=-dateCreated"
|
||||||
qs: {
|
|
||||||
conditions: JSON.stringify(conditions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
req = request.get(options, (error, response) ->
|
req = request.get(options, (error, response) ->
|
||||||
|
|
Loading…
Reference in a new issue