mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-18 11:32:25 -05:00
58716f5b75
Saw that this caused 500s on /auth/whoami with no cookies set, with this error:
debug: 500: MongoError: E11000 duplicate key error index: coco.users.$emailLower_1 dup key: { : null }
Probably we need to be much more careful about what changes this blanket change to the minimize Mongoose option might introduce, since tests didn't catch this, but it would have taken the site down for anyone not logged in already.
This reverts commit 121f07d020
.
31 lines
794 B
CoffeeScript
31 lines
794 B
CoffeeScript
require '../common'
|
|
|
|
describe 'Level', ->
|
|
|
|
level =
|
|
name: 'King\'s Peak 3'
|
|
description: 'Climb a mountain.'
|
|
permissions: simplePermissions
|
|
scripts: []
|
|
thangs: []
|
|
documentation: {specificArticles: [], generalArticles: []}
|
|
|
|
urlLevel = '/db/level'
|
|
|
|
it 'clears things first', (done) ->
|
|
clearModels [Level], (err) ->
|
|
expect(err).toBeNull()
|
|
done()
|
|
|
|
it 'can make a Level.', (done) ->
|
|
loginJoe ->
|
|
request.post {uri: getURL(urlLevel), json: level}, (err, res, body) ->
|
|
expect(res.statusCode).toBe(200)
|
|
done()
|
|
|
|
it 'get schema', (done) ->
|
|
request.get {uri: getURL(urlLevel+'/schema')}, (err, res, body) ->
|
|
expect(res.statusCode).toBe(200)
|
|
body = JSON.parse(body)
|
|
expect(body.type).toBeDefined()
|
|
done()
|