diff --git a/src/server/api.coffee b/src/server/api.coffee index d7bf239475..e6aa77476d 100644 --- a/src/server/api.coffee +++ b/src/server/api.coffee @@ -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) -> diff --git a/test/api.mocha.coffee b/test/api.mocha.coffee index 42387f2217..d9d6e95a67 100644 --- a/test/api.mocha.coffee +++ b/test/api.mocha.coffee @@ -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()