Created
January 10, 2012 21:21
-
-
Save mpj/1591281 to your computer and use it in GitHub Desktop.
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
'Graph request succeeds': when(FacebookProvider, { | |
get_me_called_with: 'fbtoken99887755', | |
should_return: { | |
id: '640798226', | |
name: 'Mattias Petter Johansson' | |
}, | |
after_calling: { | |
https: { | |
function_called: 'request', | |
with_arguments: { | |
host: 'graph.facebook.com', | |
port: 443, | |
path: '/me?access_token=' + token, | |
method: 'GET', | |
headers: { | |
'Connection': 'close' | |
} | |
}, | |
calls_returned_object: [ | |
{ | |
function_called: 'on', | |
with_arguments: 'data' | |
which_yields: [ // Call the callback sent to on('data, callback) three times | |
'{ "id": "640798226", ', | |
'"name": "Mattias Petter', | |
' Johansson" }' | |
], | |
with_delay: 25 | |
}, | |
{ | |
function_called: 'on', | |
with_arguments: 'end' | |
which_yields_delayed: null | |
with_delay: 100 | |
}, | |
] | |
} | |
} | |
}), | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment