Skip to content

Instantly share code, notes, and snippets.

@PandaWhisperer
Created July 21, 2015 01:54
Show Gist options
  • Save PandaWhisperer/f7ba73db4f836ecd7a6d to your computer and use it in GitHub Desktop.
Save PandaWhisperer/f7ba73db4f836ecd7a6d to your computer and use it in GitHub Desktop.
> [email protected] test /Users/chris/Code/fomo-server
> PORT=9999 NODE_ENV=testing _mocha ./test/bootstrap.test.js ./test/unit/*.test.js ./test/unit/**/*.test.js -r should --timeout 60000
warn: Sails' built-in layout support only works with the `ejs`, `handlebars`, `ractive` view engines.
warn: You're using `jade`.
warn: Ignoring `sails.config.views.layout`...
Connecting Mongoose to mongodb://localhost:27017/fomo
Connected Mongoose to mongodb://localhost:27017/fomo
initing mongoose schema for model Auth
initing mongoose schema for model Place
initing mongoose schema for model Settings
initing mongoose schema for model User
index
#bootstrap
✓ sails lifted
✓ app available
✓ global models available
✓ should load homepage (914ms)
UserController :: crud
#post
✓ should create user with new facebook login (296ms)
1) should update user with existing facebook id
2) should update user with existing facebook id
#get
✓ should list all users
✓ should find user by id (120ms)
#put
3) should update user
4) should update nested attributes on user
#del
5) should destroy place by id
UserController :: public functions
#savePlaceToHistory
6) should save existing place to placeHistory
#savePlaceToHistory
7) should save duplicate place to placeHistory
User :: mongoose crud
#create
✓ should create user
#read
✓ should retrieve user
#update
✓ should update user (48ms)
#destroy
✓ should delete user
11 passing (5s)
7 failing
1) UserController :: crud #post should update user with existing facebook id:
Error: expected 201 "Created", got 500 "Internal Server Error"
at net.js:1419:10
2) UserController :: crud #post should update user with existing facebook id:
TypeError: Cannot read property 'auth' of null
at test/unit/controllers/UserController.test.js:106:18
3) UserController :: crud #put should update user:
Error: expected 200 "OK", got 404 "Not Found"
at net.js:1419:10
4) UserController :: crud #put should update nested attributes on user:
Error: expected 200 "OK", got 404 "Not Found"
at net.js:1419:10
5) UserController :: crud #del should destroy place by id:
Error: expected 200 "OK", got 404 "Not Found"
at net.js:1419:10
6) UserController :: public functions #savePlaceToHistory should save existing place to placeHistory:
TypeError: Cannot set property 'visitedAt' of null
at Object.savePlaceToHistory (api/controllers/UserController.js:33:20)
7) UserController :: public functions #savePlaceToHistory should save duplicate place to placeHistory:
TypeError: Cannot set property 'visitedAt' of null
at Object.savePlaceToHistory (api/controllers/UserController.js:33:20)
at Context.<anonymous> (test/unit/controllers/UserController.test.js:272:30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment