2014-12-08 17:21:40 -05:00
|
|
|
FacebookHandler = require 'core/social-handlers/FacebookHandler'
|
2014-06-11 14:34:52 -04:00
|
|
|
|
2014-06-30 22:16:26 -04:00
|
|
|
mockAuthEvent =
|
2014-06-11 14:34:52 -04:00
|
|
|
response:
|
|
|
|
authResponse:
|
2014-06-30 22:16:26 -04:00
|
|
|
accessToken: 'aksdhjflkqjrj245234b52k345q344le4j4k5l45j45s4dkljvdaskl'
|
|
|
|
userID: '4301938'
|
2014-06-11 14:34:52 -04:00
|
|
|
expiresIn: 5138
|
2014-06-30 22:16:26 -04:00
|
|
|
signedRequest: 'akjsdhfjkhea.3423nkfkdsejnfkd'
|
|
|
|
status: 'connected'
|
2014-06-11 14:34:52 -04:00
|
|
|
|
2014-06-30 22:16:26 -04:00
|
|
|
window.FB ?= {
|
2014-06-11 16:43:07 -04:00
|
|
|
api: ->
|
2015-12-11 18:39:07 -05:00
|
|
|
login: ->
|
2014-06-11 16:43:07 -04:00
|
|
|
}
|
2014-06-30 22:16:26 -04:00
|
|
|
|
2014-06-11 14:34:52 -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})
|
2014-06-11 14:34:52 -04:00
|
|
|
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()
|
2014-08-27 15:24:03 -04:00
|
|
|
Backbone.Mediator.publish 'auth:logged-in-with-facebook', mockAuthEvent
|
2014-06-30 22:16:26 -04:00
|
|
|
|