mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-05-20 04:38:45 +00:00
Fix AuthCtrl tests with proper asserts
This commit is contained in:
parent
d9779d8e51
commit
d58568c9d8
1 changed files with 4 additions and 4 deletions
|
|
@ -22,16 +22,16 @@ describe('Auth Controller', function() {
|
|||
$httpBackend.expectPOST('/api/v2/user/auth/local').respond({id: 'abc', token: 'abc'});
|
||||
scope.auth();
|
||||
$httpBackend.flush();
|
||||
expect(user.authenticate).to.have.been.calledOnce;
|
||||
expect($window.alert).to.not.have.been.called;
|
||||
sinon.assert.calledOnce(user.authenticate);
|
||||
sinon.assert.notCalled($window.alert);
|
||||
});
|
||||
|
||||
it('should not log in users with incorrect uname / pass', function() {
|
||||
$httpBackend.expectPOST('/api/v2/user/auth/local').respond(404, '');
|
||||
scope.auth();
|
||||
$httpBackend.flush();
|
||||
expect(user.authenticate).to.not.have.been.called;
|
||||
expect($window.alert).to.have.been.calledOnce;
|
||||
sinon.assert.notCalled(user.authenticate);
|
||||
sinon.assert.calledOnce($window.alert);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue