mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 16:51:35 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
0bddd45e97
2 changed files with 9 additions and 1 deletions
|
@ -52,7 +52,9 @@ module.exports =
|
|||
classroomMap[classroom.id] = classroom for classroom in classrooms
|
||||
levelOriginal = level.get('original')
|
||||
for courseInstance in courseInstances
|
||||
classroom = classroomMap[courseInstance.get('classroomID').toString()]
|
||||
classroomID = courseInstance.get('classroomID')
|
||||
continue unless classroomID
|
||||
classroom = classroomMap[classroomID.toString()]
|
||||
courseID = courseInstance.get('courseID')
|
||||
classroomCourse = _.find(classroom.get('courses'), (c) -> c._id.equals(courseID))
|
||||
for courseLevel in classroomCourse.levels
|
||||
|
|
|
@ -81,6 +81,12 @@ describe 'GET /db/level/:handle/session', ->
|
|||
expect(body.codeLanguage).toBe('python')
|
||||
done()
|
||||
|
||||
it 'does not break if the user has a courseInstance without an associated classroom', utils.wrap (done) ->
|
||||
yield @courseInstance.update({$unset: {classroomID: ''}})
|
||||
[res, body] = yield request.getAsync { uri: @url, json: true }
|
||||
expect(res.statusCode).toBe(402)
|
||||
done()
|
||||
|
||||
it 'returns 402 if the user is not in a course with that level', utils.wrap (done) ->
|
||||
otherStudent = yield utils.initUser({role: 'student'})
|
||||
yield utils.loginUser(otherStudent)
|
||||
|
|
Loading…
Reference in a new issue