codecombat/test/app/core/social-handlers/FacebookHandler.spec.coffee

27 lines
722 B
CoffeeScript
Raw Normal View History

FacebookHandler = require 'core/social-handlers/FacebookHandler'
2014-06-30 22:16:26 -04:00
mockAuthEvent =
response:
authResponse:
2014-06-30 22:16:26 -04:00
accessToken: 'aksdhjflkqjrj245234b52k345q344le4j4k5l45j45s4dkljvdaskl'
userID: '4301938'
expiresIn: 5138
2014-06-30 22:16:26 -04:00
signedRequest: 'akjsdhfjkhea.3423nkfkdsejnfkd'
status: 'connected'
2014-06-30 22:16:26 -04:00
window.FB ?= {
api: ->
2015-12-11 18:39:07 -05:00
login: ->
}
2014-06-30 22:16:26 -04:00
describe 'lib/FacebookHandler.coffee', ->
it 'on facebook-logged-in, gets data from FB and sends a patch to the server', ->
2014-06-30 22:16:26 -04:00
me.clear({silent: true})
me.markToRevert()
me.set({_id: '12345'})
2014-06-30 22:16:26 -04:00
2015-12-11 18:39:07 -05:00
facebookHandler = new FacebookHandler()
facebookHandler.loginThroughFacebook()
Backbone.Mediator.publish 'auth:logged-in-with-facebook', mockAuthEvent
2014-06-30 22:16:26 -04:00