mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-18 18:12:10 +00: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.ace.pdfViewer = req.body.pdfViewer
|
||||||
user.save (err)->
|
user.save (err)->
|
||||||
if !newEmail? or newEmail.length == 0 or newEmail.indexOf("@") == -1
|
if !newEmail? or newEmail.length == 0 or newEmail.indexOf("@") == -1
|
||||||
return res.send(412)
|
return res.send(400)
|
||||||
else if newEmail == user.email
|
else if newEmail == user.email
|
||||||
return res.send 200
|
return res.send 200
|
||||||
else
|
else
|
||||||
|
|
|
@ -107,21 +107,21 @@ describe "UserController", ->
|
||||||
it "should return an error if the email address is null", (done)->
|
it "should return an error if the email address is null", (done)->
|
||||||
@req.body.email = null
|
@req.body.email = null
|
||||||
@res.send = (code)->
|
@res.send = (code)->
|
||||||
code.should.equal 412
|
code.should.equal 400
|
||||||
done()
|
done()
|
||||||
@UserController.updateUserSettings @req, @res
|
@UserController.updateUserSettings @req, @res
|
||||||
|
|
||||||
it "should send an error if the email is 0 len", (done)->
|
it "should send an error if the email is 0 len", (done)->
|
||||||
@req.body.email = ""
|
@req.body.email = ""
|
||||||
@res.send = (code)->
|
@res.send = (code)->
|
||||||
code.should.equal 412
|
code.should.equal 400
|
||||||
done()
|
done()
|
||||||
@UserController.updateUserSettings @req, @res
|
@UserController.updateUserSettings @req, @res
|
||||||
|
|
||||||
it "should send an error if the email does not contain an @", (done)->
|
it "should send an error if the email does not contain an @", (done)->
|
||||||
@req.body.email = "bob at something dot com"
|
@req.body.email = "bob at something dot com"
|
||||||
@res.send = (code)->
|
@res.send = (code)->
|
||||||
code.should.equal 412
|
code.should.equal 400
|
||||||
done()
|
done()
|
||||||
@UserController.updateUserSettings @req, @res
|
@UserController.updateUserSettings @req, @res
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue