Skip to content

Commit

Permalink
more error coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Jul 18, 2016
1 parent a299c43 commit c085933
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/phabs_test.coffee
Expand Up @@ -414,6 +414,21 @@ describe 'hubot-phabs module', ->
expect(hubotResponse()).to.eql 'Ok, T42 now has status Spite.'

# ---------------------------------------------------------------------------------
context 'error: non json', ->
beforeEach ->
do nock.disableNetConnect
nock(process.env.PHABRICATOR_URL)
.get('/api/maniphest.update')
.reply(200, '<body></body>', { 'Content-type': 'text/html' })

afterEach ->
nock.cleanAll()

context 'phab T42 spite', ->
hubot 'phab T42 spite'
it 'reports a lib error', ->
expect(hubotResponse()).to.eql 'oops T42 api did not deliver json'

context 'error: lib error', ->
beforeEach ->
do nock.disableNetConnect
Expand Down

0 comments on commit c085933

Please sign in to comment.