mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 00:28:31 -05:00
28 lines
696 B
CoffeeScript
28 lines
696 B
CoffeeScript
require '../common'
|
|
|
|
describe 'Level', ->
|
|
|
|
level =
|
|
name: "King's Peak 3"
|
|
description: 'Climb a mountain.'
|
|
permissions: simplePermissions
|
|
|
|
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()
|