Test that server can handle a relative as well as an absolute url

This commit is contained in:
Juan Cruz Viotti 2014-11-20 12:33:07 -04:00
parent 574d612624
commit 322fed866d

View File

@ -1,5 +1,6 @@
expect = require('chai').expect
nock = require('nock')
url = require('url')
server = require('./server')
config = require('../config')
token = require('../token/token')
@ -126,6 +127,15 @@ describe 'Server:', ->
expect(error).to.be.an.instanceof(Error)
done()
it 'should accept a full url', (done) ->
server.request {
method: 'GET'
url: url.resolve(config.remoteUrl, URI.ok)
}, (error, response) ->
expect(error).to.not.exist
expect(response.body.status).to.equal(STATUS.ok)
done()
checkRequestTypeWithoutBody = (type) ->
return (done) ->
lowercaseType = type.toLowerCase()