codecombat/test/server/handlers/level_draft.spec.coffee
2014-01-03 10:32:13 -08:00

23 lines
No EOL
557 B
CoffeeScript

require '../common'
describe '/db/campaign_draft', ->
draft = {
level: {}
user: 'yoyoyo'
}
request = require 'request'
it 'clears the db first', (done) ->
clearModels [LevelDraft], (err) ->
throw err if err
done()
url = getURL('/db/level_draft')
it 'can make a LevelDraft, and ignores the user property given.', (done) ->
loginJoe (joe) ->
request.post {uri:url, json:draft}, (err, res, body) ->
expect(res.statusCode).toBe(200)
expect(body.user).toBe(joe._id.toString())
done()