Rename config.baseUrl to config.remoteUrl

This commit is contained in:
Juan Cruz Viotti 2014-11-18 08:53:07 -04:00
parent d0cc3e54ad
commit 2fd2b702ae
4 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ describe 'Auth:', ->
describe 'given valid credentials', -> describe 'given valid credentials', ->
beforeEach -> beforeEach ->
nock(config.baseUrl) nock(config.remoteUrl)
.post('/login_', johnDoeFixture.credentials) .post('/login_', johnDoeFixture.credentials)
.reply(200, johnDoeFixture.token) .reply(200, johnDoeFixture.token)
@ -62,7 +62,7 @@ describe 'Auth:', ->
describe 'given invalid credentials', -> describe 'given invalid credentials', ->
beforeEach -> beforeEach ->
nock(config.baseUrl) nock(config.remoteUrl)
.post('/login_') .post('/login_')
.reply(401) .reply(401)
@ -87,11 +87,11 @@ describe 'Auth:', ->
describe 'given a logged in user', -> describe 'given a logged in user', ->
beforeEach (done) -> beforeEach (done) ->
nock(config.baseUrl) nock(config.remoteUrl)
.post('/login_', johnDoeFixture.credentials) .post('/login_', johnDoeFixture.credentials)
.reply(200, johnDoeFixture.token) .reply(200, johnDoeFixture.token)
nock(config.baseUrl) nock(config.remoteUrl)
.post('/login_', janeDoeFixture.credentials) .post('/login_', janeDoeFixture.credentials)
.reply(200, janeDoeFixture.token) .reply(200, janeDoeFixture.token)

View File

@ -3,5 +3,5 @@ path = require('path')
module.exports = module.exports =
# TODO: Should be configurable # TODO: Should be configurable
baseUrl: 'https://staging.resin.io' remoteUrl: 'https://staging.resin.io'
dataPrefix: path.join(process.env.HOME, '.resin') dataPrefix: path.join(process.env.HOME, '.resin')

View File

@ -6,7 +6,7 @@ token = require('../token/token')
exports.request = (method = 'GET', url, json, callback) -> exports.request = (method = 'GET', url, json, callback) ->
method = method.toUpperCase() method = method.toUpperCase()
url = urljoin(config.baseUrl, url) url = urljoin(config.remoteUrl, url)
async.waterfall [ async.waterfall [

View File

@ -6,7 +6,7 @@ token = require('../token/token')
mock = require('../../tests/utils/mock') mock = require('../../tests/utils/mock')
johnDoeFixture = require('../../tests/fixtures/johndoe.json') johnDoeFixture = require('../../tests/fixtures/johndoe.json')
TEST_URI = config.baseUrl TEST_URI = config.remoteUrl
URI = URI =
ok: '/ok' ok: '/ok'