Created
July 6, 2017 07:38
-
-
Save kscc25/c2db48b8538e64319744007b3cc9d317 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('The toggleFollow function', function() { | |
it('should unfollow the followed user', function() { | |
// mock | |
followService.isFollowing = function() { | |
return true; | |
}; | |
var controller = initController(); | |
controller.toggleFollow(); | |
expect(followService.unfollow).to.have.been.calledOnce; | |
expect(controller.isFollowing).to.be.false; | |
}); | |
it('should follow the unfollowed user', function() { | |
// mock | |
followService.isFollowing = function() { | |
return false; | |
}; | |
var controller = initController(); | |
controller.toggleFollow(); | |
expect(followService.follow).to.have.been.calledOnce; | |
expect(controller.isFollowing).to.be.true; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment