mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-20 16:25:43 +00:00
added test for a 200 status on unsupported language
GitOrigin-RevId: 802dc736969bbc48aa3beb9eb90b17dfdb59fff2
This commit is contained in:
parent
762fde5ae7
commit
b3501a40e3
1 changed files with 12 additions and 3 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue