2014-01-03 13:32:13 -05:00
|
|
|
require '../common'
|
|
|
|
|
|
|
|
describe 'Level', ->
|
|
|
|
|
|
|
|
level =
|
2014-06-30 22:16:26 -04:00
|
|
|
name: 'King\'s Peak 3'
|
2014-01-03 13:32:13 -05:00
|
|
|
description: 'Climb a mountain.'
|
|
|
|
permissions: simplePermissions
|
2014-04-08 17:10:50 -04:00
|
|
|
scripts: []
|
|
|
|
thangs: []
|
2015-01-09 14:56:49 -05:00
|
|
|
documentation: {specificArticles: [{}], generalArticles: []}
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-01-23 17:06:12 -05:00
|
|
|
urlLevel = '/db/level'
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
it 'clears things first', (done) ->
|
|
|
|
clearModels [Level], (err) ->
|
|
|
|
expect(err).toBeNull()
|
|
|
|
done()
|
|
|
|
|
|
|
|
it 'can make a Level.', (done) ->
|
2014-01-15 14:36:59 -05:00
|
|
|
loginJoe ->
|
2014-06-30 22:16:26 -04:00
|
|
|
request.post {uri: getURL(urlLevel), json: level}, (err, res, body) ->
|
2014-01-03 13:32:13 -05:00
|
|
|
expect(res.statusCode).toBe(200)
|
2014-01-23 17:06:12 -05:00
|
|
|
done()
|
|
|
|
|
|
|
|
it 'get schema', (done) ->
|
2014-06-30 22:16:26 -04:00
|
|
|
request.get {uri: getURL(urlLevel+'/schema')}, (err, res, body) ->
|
2014-01-23 17:06:12 -05:00
|
|
|
expect(res.statusCode).toBe(200)
|
|
|
|
body = JSON.parse(body)
|
|
|
|
expect(body.type).toBeDefined()
|
|
|
|
done()
|