Moved config to ngConstant to mount that from outside the container
Change-Id: I23169cdeeae9034ea97e94089dcdbca3179bbb23
diff --git a/src/app/datasources/rest/auth.rest.spec.ts b/src/app/datasources/rest/auth.rest.spec.ts
index 16c0f8d..483bcfc 100644
--- a/src/app/datasources/rest/auth.rest.spec.ts
+++ b/src/app/datasources/rest/auth.rest.spec.ts
@@ -3,7 +3,6 @@
import 'angular-resource';
import 'angular-cookies';
import {xosDataSources} from '../index';
-import {AppConfig} from '../../config/app.config';
import {IXosAuthService} from './auth.rest';
let service: IXosAuthService;
@@ -11,11 +10,20 @@
let $scope;
let $cookies;
+const MockAppCfg = {
+ apiEndpoint: 'http://xos-test:3000/api',
+ websocketClient: 'http://xos-test:3000'
+};
+
describe('The AuthService service', () => {
beforeEach(angular.mock.module(xosDataSources));
beforeEach(() => {
+
+ angular.module(xosDataSources)
+ .constant('AppConfig', MockAppCfg);
+
angular.mock.module(xosDataSources);
});
@@ -34,7 +42,7 @@
describe('when logging in', () => {
beforeEach(() => {
- httpBackend.expectPOST(`${AppConfig.apiEndpoint}/utility/login/`)
+ httpBackend.expectPOST(`${MockAppCfg.apiEndpoint}/utility/login/`)
.respond({
user: JSON.stringify({usernane: 'test@xos.org'}),
xoscsrftoken: 'token',
@@ -59,7 +67,7 @@
describe('when logging out', () => {
beforeEach(() => {
- httpBackend.expectPOST(`${AppConfig.apiEndpoint}/utility/logout/`)
+ httpBackend.expectPOST(`${MockAppCfg.apiEndpoint}/utility/logout/`)
.respond({
user: JSON.stringify({usernane: 'test@xos.org'}),
xoscsrftoken: 'token',