Remove unused helpers.constructRemoteUrl

This commit is contained in:
Juan Cruz Viotti 2014-12-02 09:50:59 -04:00
parent d3df9bff1a
commit 2911caf7f8
2 changed files with 0 additions and 23 deletions

View File

@ -13,10 +13,3 @@ exports.isDeviceUUIDValid = (uuid, callback) ->
return callback?(error) if error?
uuidExists = _.findWhere(devices, { uuid })?
return callback(null, uuidExists)
exports.constructRemoteUrl = (base, path, query) ->
if not _.isEmpty(query)
formattedQuery = url.format({ query })
path = url.resolve(path, formattedQuery)
return url.resolve(base, path)

View File

@ -63,19 +63,3 @@ describe 'Helpers:', ->
expect(error).to.not.exist
expect(isValid).to.be.false
done()
describe '#constructRemoteUrl', ->
URL =
base: 'http://google.com'
path: '/search'
query:
foo: 'bar'
it 'should concatenate a url and a path', ->
result = helpers.constructRemoteUrl(URL.base, URL.path)
expect(result).to.equal(URL.base + URL.path)
it 'should add url queries', ->
result = helpers.constructRemoteUrl(URL.base, URL.path, URL.query)
expect(result).to.equal("#{URL.base}#{URL.path}?foo=bar")