diff --git a/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js b/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js index dd2b532e..86faa40f 100644 --- a/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js +++ b/public/modules/forms/tests/unit/controllers/admin-form.client.controller.test.js @@ -138,9 +138,6 @@ }, isAuthenticated: function() { return true; - }, - getUserState: function() { - return true; } }; }); diff --git a/public/modules/users/services/auth.client.service.js b/public/modules/users/services/auth.client.service.js index 4ca7c621..48ea544f 100644 --- a/public/modules/users/services/auth.client.service.js +++ b/public/modules/users/services/auth.client.service.js @@ -47,10 +47,6 @@ angular.module('users').factory('Auth', ['$window', '$q', 'User', return !!this._currentUser && this._currentUser.username; }, - getUserState: function() { - return userState; - }, - login: function(new_user) { userState.isLoggedIn = true; this._currentUser = new_user; diff --git a/public/modules/users/tests/unit/controllers/authentication.client.controller.test.js b/public/modules/users/tests/unit/controllers/authentication.client.controller.test.js index beaa09ca..018ccc8a 100644 --- a/public/modules/users/tests/unit/controllers/authentication.client.controller.test.js +++ b/public/modules/users/tests/unit/controllers/authentication.client.controller.test.js @@ -133,9 +133,6 @@ }, isAuthenticated: function() { return true; - }, - getUserState: function() { - return true; } }; }); diff --git a/public/modules/users/tests/unit/services/auth.client.service.test.js b/public/modules/users/tests/unit/services/auth.client.service.test.js index ea7a0f88..26c2715a 100644 --- a/public/modules/users/tests/unit/services/auth.client.service.test.js +++ b/public/modules/users/tests/unit/services/auth.client.service.test.js @@ -61,23 +61,8 @@ expect($window.user).toEqual(null); expect(Auth.currentUser).toEqual(null); expect(Auth.isAuthenticated()).toBe(false); - expect(Auth.getUserState().isLoggedIn).toBe(false); })); - - it('Auth.getUserState() should fetch current user state', function() { - //Run Service Logic to Test - Auth.login(sampleUser); - var currUserState = Auth.getUserState(); - - expect(currUserState.isLoggedIn).toBe(true); - - //Run Service Logic to Test - Auth.logout(); - currUserState = Auth.getUserState(); - - expect(currUserState.isLoggedIn).toBe(false); - }); - + it('Auth.ensureHasCurrentUser() should fetch most current user if it exists in $window, currentUser or fetch it from /users/me', function() { //Run Service Logic to Test Auth.ensureHasCurrentUser().then(function onSuccess(currUser){