removed getUserState from Auth service
This commit is contained in:
parent
1c4ce87084
commit
f3f9232c62
@ -138,9 +138,6 @@
|
||||
},
|
||||
isAuthenticated: function() {
|
||||
return true;
|
||||
},
|
||||
getUserState: function() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -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;
|
||||
|
@ -133,9 +133,6 @@
|
||||
},
|
||||
isAuthenticated: function() {
|
||||
return true;
|
||||
},
|
||||
getUserState: function() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user