Fix FacebookHandler and its test

This commit is contained in:
Scott Erickson 2015-12-11 15:39:07 -08:00
parent 703671940f
commit d081f7553d
2 changed files with 4 additions and 2 deletions

View file

@ -29,7 +29,7 @@ module.exports = FacebookHandler = class FacebookHandler extends CocoClass
break
if @waitingForLogin and @loggedIn
@fetchMeForLogin
@fetchMeForLogin()
loginThroughFacebook: ->
if @loggedIn

View file

@ -51,6 +51,7 @@ mockMe =
window.FB ?= {
api: ->
login: ->
}
describe 'lib/FacebookHandler.coffee', ->
@ -61,7 +62,8 @@ describe 'lib/FacebookHandler.coffee', ->
spyOn FB, 'api'
new FacebookHandler()
facebookHandler = new FacebookHandler()
facebookHandler.loginThroughFacebook()
Backbone.Mediator.publish 'auth:logged-in-with-facebook', mockAuthEvent
expect(FB.api).toHaveBeenCalled()