mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Fix FacebookHandler and its test
This commit is contained in:
parent
703671940f
commit
d081f7553d
2 changed files with 4 additions and 2 deletions
|
@ -29,7 +29,7 @@ module.exports = FacebookHandler = class FacebookHandler extends CocoClass
|
|||
break
|
||||
|
||||
if @waitingForLogin and @loggedIn
|
||||
@fetchMeForLogin
|
||||
@fetchMeForLogin()
|
||||
|
||||
loginThroughFacebook: ->
|
||||
if @loggedIn
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue