added test for a 200 status on unsupported language

GitOrigin-RevId: 802dc736969bbc48aa3beb9eb90b17dfdb59fff2
This commit is contained in:
mserranom 2019-07-16 11:08:55 +00:00 committed by sharelatex
parent 762fde5ae7
commit b3501a40e3

View file

@ -56,9 +56,8 @@ describe('SpellingController', function() {
headers: { Host: SPELLING_HOST }
}
this.res = {
send: sinon.stub()
}
this.res = {}
this.res.send = sinon.stub()
this.res.status = sinon.stub().returns(this.res)
this.res.end = sinon.stub()
this.res.json = sinon.stub()
@ -103,6 +102,16 @@ describe('SpellingController', function() {
it('should not send a request to the spelling host', function() {
this.request.called.should.equal(false)
})
it('should return an empty misspellings array', function() {
this.res.send
.calledWith(JSON.stringify({ misspellings: [] }))
.should.equal(true)
})
it('should return a 200 status', function() {
this.res.status.calledWith(200).should.equal(true)
})
})
})
})