mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 16:02:14 +00:00
Cleanup
This commit is contained in:
parent
7ce7677816
commit
e4f4227072
2 changed files with 4 additions and 4 deletions
|
|
@ -11,12 +11,11 @@ icalendar = require 'icalendar'
|
|||
NO_TOKEN_OR_UID = err: "You must include a token and uid (user id) in your request"
|
||||
NO_USER_FOUND = err: "No user found."
|
||||
|
||||
# ---------- /v1 API ------------
|
||||
# Every url added beneath router is prefaced by /v1
|
||||
# ---------- /api/v1 API ------------
|
||||
# Every url added beneath router is prefaced by /api/v1
|
||||
|
||||
###
|
||||
v1 API. Requires user-id and apiToken, task-id, direction. Test with:
|
||||
curl -X POST -H "Content-Type:application/json" -d '{"apiToken":"{TOKEN}"}' localhost:3000/v1/users/{UID}/tasks/productivity/up
|
||||
###
|
||||
|
||||
auth = (req, res, next) ->
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ describe 'API', ->
|
|||
model.refList "_#{type}List", "_user.tasks", "_user.#{type}Ids"
|
||||
tasks = tasks.concat model.get("_#{type}List")
|
||||
# Ensure that user owns the tasks
|
||||
console.log _.difference(_.pluck(res.body,'id'), _.pluck(tasks,'id'))
|
||||
expect(res.body.length).to.equal tasks.length
|
||||
# Ensure that the two sets are equal
|
||||
expect(_.difference(_.pluck(res.body,'id'), _.pluck(tasks,'id')).length).to.equal 0
|
||||
done()
|
||||
|
|
|
|||
Loading…
Reference in a new issue