From 2fd2b702aecfd238d87746ecd9fda59ac382649c Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 18 Nov 2014 08:53:07 -0400 Subject: [PATCH] Rename config.baseUrl to config.remoteUrl --- lib/auth/auth.spec.coffee | 8 ++++---- lib/config.coffee | 2 +- lib/server/server.coffee | 2 +- lib/server/server.spec.coffee | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/auth/auth.spec.coffee b/lib/auth/auth.spec.coffee index c4a06b6f..312fe5f1 100644 --- a/lib/auth/auth.spec.coffee +++ b/lib/auth/auth.spec.coffee @@ -21,7 +21,7 @@ describe 'Auth:', -> describe 'given valid credentials', -> beforeEach -> - nock(config.baseUrl) + nock(config.remoteUrl) .post('/login_', johnDoeFixture.credentials) .reply(200, johnDoeFixture.token) @@ -62,7 +62,7 @@ describe 'Auth:', -> describe 'given invalid credentials', -> beforeEach -> - nock(config.baseUrl) + nock(config.remoteUrl) .post('/login_') .reply(401) @@ -87,11 +87,11 @@ describe 'Auth:', -> describe 'given a logged in user', -> beforeEach (done) -> - nock(config.baseUrl) + nock(config.remoteUrl) .post('/login_', johnDoeFixture.credentials) .reply(200, johnDoeFixture.token) - nock(config.baseUrl) + nock(config.remoteUrl) .post('/login_', janeDoeFixture.credentials) .reply(200, janeDoeFixture.token) diff --git a/lib/config.coffee b/lib/config.coffee index a7b15cba..b8d8e7c7 100644 --- a/lib/config.coffee +++ b/lib/config.coffee @@ -3,5 +3,5 @@ path = require('path') module.exports = # TODO: Should be configurable - baseUrl: 'https://staging.resin.io' + remoteUrl: 'https://staging.resin.io' dataPrefix: path.join(process.env.HOME, '.resin') diff --git a/lib/server/server.coffee b/lib/server/server.coffee index af06c6f4..fa9727dd 100644 --- a/lib/server/server.coffee +++ b/lib/server/server.coffee @@ -6,7 +6,7 @@ token = require('../token/token') exports.request = (method = 'GET', url, json, callback) -> method = method.toUpperCase() - url = urljoin(config.baseUrl, url) + url = urljoin(config.remoteUrl, url) async.waterfall [ diff --git a/lib/server/server.spec.coffee b/lib/server/server.spec.coffee index 29cf5582..a964ceb6 100644 --- a/lib/server/server.spec.coffee +++ b/lib/server/server.spec.coffee @@ -6,7 +6,7 @@ token = require('../token/token') mock = require('../../tests/utils/mock') johnDoeFixture = require('../../tests/fixtures/johndoe.json') -TEST_URI = config.baseUrl +TEST_URI = config.remoteUrl URI = ok: '/ok'