mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Add POST /db/level/:handle test
It's erroring in my dev console, complaining of duplicate keys, and not sure why. Adding a test to make sure creating a new level version doesn't break.
This commit is contained in:
parent
feeca7a586
commit
b255b02854
1 changed files with 15 additions and 0 deletions
|
@ -39,6 +39,21 @@ describe 'Level', ->
|
|||
body = JSON.parse(body)
|
||||
expect(body.type).toBeDefined()
|
||||
done()
|
||||
|
||||
|
||||
describe 'POST /db/level/:handle', ->
|
||||
it 'creates a new version', utils.wrap (done) ->
|
||||
yield utils.clearModels([Campaign, Course, CourseInstance, Level, User])
|
||||
admin = yield utils.initAdmin()
|
||||
yield utils.loginUser(admin)
|
||||
@level = yield utils.makeLevel()
|
||||
levelJSON = @level.toObject()
|
||||
levelJSON.name = 'New name'
|
||||
|
||||
url = getURL("/db/level/#{@level.id}")
|
||||
[res, body] = yield request.postAsync({url: url, json: levelJSON})
|
||||
expect(res.statusCode).toBe(200)
|
||||
done()
|
||||
|
||||
|
||||
describe 'GET /db/level/:handle/session', ->
|
||||
|
|
Loading…
Reference in a new issue