Fixed a couple tests.

This commit is contained in:
Scott Erickson 2014-07-10 14:31:25 -07:00
parent f17e24013b
commit ad2e01ee61

View file

@ -21,14 +21,8 @@ describe 'LevelComponent', ->
expect(err).toBeNull() expect(err).toBeNull()
done() done()
it 'can\'t be created by ordinary users.', (done) -> it 'can be created by ordinary users.', (done) ->
loginJoe -> loginJoe ->
request.post {uri: url, json: component}, (err, res, body) ->
expect(res.statusCode).toBe(403)
done()
it 'can be created by an admin.', (done) ->
loginAdmin ->
request.post {uri: url, json: component}, (err, res, body) -> request.post {uri: url, json: component}, (err, res, body) ->
expect(res.statusCode).toBe(200) expect(res.statusCode).toBe(200)
expect(body._id).toBeDefined() expect(body._id).toBeDefined()
@ -105,7 +99,8 @@ describe 'LevelComponent', ->
components[0].official = true components[0].official = true
loginJoe -> loginJoe ->
request.post {uri: url, json: components[0]}, (err, res, body) -> request.post {uri: url, json: components[0]}, (err, res, body) ->
expect(res.statusCode).toBe(403) expect(res.statusCode).toBe(200)
expect(body.official).toBe(false)
done() done()
it 'official property is editable by an admin.', (done) -> it 'official property is editable by an admin.', (done) ->