DoSomethingArchive / quicksilver-api

:postbox: API gateway to Quicksilver (Message Broker) functionality.
MIT License
0 stars 3 forks source link

Issue33 user password test coverage #36

Closed deezone closed 8 years ago

deezone commented 8 years ago

Fixes #33

Adds very basic test coverage for /user/password for:

To Test:

$npm test

currently produces:

  5) Requests to the root (/user/password) path with missing required body parameters. POST: Invalid password reset request with missing body parameters returns expected 422 - Unprocessable due to request validation error results.:
     Uncaught Error: expected 422 "Unprocessable Entity", got 404 "Not Found"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at net.js:1419:10

  6) Requests to the root (/user/password) path POST: Valid password request with only user_id returns expected results.:
     Uncaught Error: expected 200 "OK", got 404 "Not Found"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at net.js:1419:10

  7) Requests to the root (/user/password) path POST: Valid password request with only email returns expected results.:
     Uncaught Error: expected 200 "OK", got 404 "Not Found"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at net.js:1419:10

  8) Requests to the root (/user/password) path POST: Valid password request with only mobile returns expected results.:
     Uncaught Error: expected 201 "Created", got 404 "Not Found"
      at Test._assertStatus (node_modules/supertest/lib/test.js:232:12)
      at Test._assertFunction (node_modules/supertest/lib/test.js:247:11)
      at Test.assert (node_modules/supertest/lib/test.js:148:18)
      at Server.assert (node_modules/supertest/lib/test.js:127:12)
      at net.js:1419:10

References:

sergiitk commented 8 years ago

:+1: