mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
changed 412 status code to 400
This commit is contained in:
parent
de38cbf595
commit
a53d767eca
2 changed files with 4 additions and 4 deletions
|
@ -44,7 +44,7 @@ module.exports =
|
|||
user.ace.pdfViewer = req.body.pdfViewer
|
||||
user.save (err)->
|
||||
if !newEmail? or newEmail.length == 0 or newEmail.indexOf("@") == -1
|
||||
return res.send(412)
|
||||
return res.send(400)
|
||||
else if newEmail == user.email
|
||||
return res.send 200
|
||||
else
|
||||
|
|
|
@ -107,21 +107,21 @@ describe "UserController", ->
|
|||
it "should return an error if the email address is null", (done)->
|
||||
@req.body.email = null
|
||||
@res.send = (code)->
|
||||
code.should.equal 412
|
||||
code.should.equal 400
|
||||
done()
|
||||
@UserController.updateUserSettings @req, @res
|
||||
|
||||
it "should send an error if the email is 0 len", (done)->
|
||||
@req.body.email = ""
|
||||
@res.send = (code)->
|
||||
code.should.equal 412
|
||||
code.should.equal 400
|
||||
done()
|
||||
@UserController.updateUserSettings @req, @res
|
||||
|
||||
it "should send an error if the email does not contain an @", (done)->
|
||||
@req.body.email = "bob at something dot com"
|
||||
@res.send = (code)->
|
||||
code.should.equal 412
|
||||
code.should.equal 400
|
||||
done()
|
||||
@UserController.updateUserSettings @req, @res
|
||||
|
||||
|
|
Loading…
Reference in a new issue