Created
January 14, 2011 02:04
-
-
Save jeffdeville/779027 to your computer and use it in GitHub Desktop.
mocking the logging in of a user using the facebook javascript sdk.
This file contains 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('user is not logged in', function(){ | |
it('should log in the user', function(){ | |
var response = { | |
session: null | |
}; | |
spyOn(FB, 'init'); | |
spyOn(FB, 'getLoginStatus'); | |
spyOn(FB, 'login'); | |
step2._initialize(); | |
expect(FB.init).toHaveBeenCalled(); | |
expect(FB.getLoginStatus).toHaveBeenCalled(); | |
FB.getLoginStatus.mostRecentCall.args[0](response); | |
expect(FB.login).toHaveBeenCalled(); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment