diff --git a/app/scripts/app.js b/app/scripts/app.js index 57b3a217..e53c3d97 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -58,7 +58,4 @@ angular.module('lmisChromeApp', [ // Convenience property to get the current state $rootScope.$state = $state; - - // Default state - $state.go('home.index.mainActivity'); }); diff --git a/app/scripts/controllers/home.js b/app/scripts/controllers/home.js index c94330dd..b7e05008 100644 --- a/app/scripts/controllers/home.js +++ b/app/scripts/controllers/home.js @@ -1,9 +1,11 @@ 'use strict'; angular.module('lmisChromeApp') - .config(function($stateProvider) { + .config(function($urlRouterProvider, $stateProvider) { + // Initial state + $urlRouterProvider.otherwise('/main-activity'); $stateProvider.state('home', { - url: '/home', + url: '', abstract: true, templateUrl: 'views/home/index.html', resolve: { diff --git a/test/spec/controllers/home.js b/test/spec/controllers/home.js index d0959265..89b32a50 100644 --- a/test/spec/controllers/home.js +++ b/test/spec/controllers/home.js @@ -31,7 +31,7 @@ describe('Home controller', function () { var state = 'home.index.mainActivity'; it('should respond to URL', function() { - expect($state.href(state)).toEqual('#/home/main-activity'); + expect($state.href(state)).toEqual('#/main-activity'); }); it('should go to the main activity state', function() { diff --git a/test/spec/services/alertsfactory.js b/test/spec/services/alertsfactory.js index 29decc58..c63bca4c 100644 --- a/test/spec/services/alertsfactory.js +++ b/test/spec/services/alertsfactory.js @@ -100,13 +100,13 @@ describe('Service: alertsFactory', function() { scope.$apply(function() { $state.go(ma); alertsFactory.add({message: 'Test'}); + expect(scope.alerts.length).toEqual(1); }); - expect(scope.alerts.length).toEqual(1); scope.$apply(function() { $state.go(dash); + expect(scope.alerts.length).toEqual(0); }); - expect(scope.alerts.length).toEqual(0); }); });