Adding test for passing back the extra data to the OAuth2 getOAuthAccessToken caller
This commit is contained in:
parent
e4cc471160
commit
6fa0288805
@ -10,6 +10,7 @@ Also provides rudimentary OAuth2 support, tested against facebook connect and gi
|
||||
Change History
|
||||
==============
|
||||
|
||||
* 0.10.0 - OAuth2: Pass back any extra response data for calls to getOAuthAccessToken (Thanks to Tang Bo Hao)
|
||||
* 0.9.6 - Support for 302 redirects on OAuth2 (Thanks Patrick Negri). Some code tidying. ( Thanks to Raoul Millais )
|
||||
* 0.9.5 - Allow usage of HTTP verbs other than GET for retrieving the access and request tokens (OAuth1) (Thanks to Raoul Millais)
|
||||
* 0.9.4 - Support for OAuth providers that drop connections (don't send response lengths? [Google]) And change OAuth2 getOAuthAccessToken to POST rather than GET ( Possible Breaking change!!! ... re-tested against Google, Github, Facebook, FourSquare and Janrain and seems ok .. is closer to the spec (v20) )
|
||||
@ -39,3 +40,4 @@ Contributors
|
||||
* Ryan LeFevre - http://meltingice.net
|
||||
* Raoul Millais
|
||||
* Patrick Negri - http://github.com/pnegri
|
||||
* Tang Bo Hao - http://github.com/btspoony
|
||||
|
@ -22,6 +22,18 @@ vows.describe('OAuth2').addBatch({
|
||||
assert.equal( access_token, "access");
|
||||
assert.equal( refresh_token, "refresh");
|
||||
});
|
||||
},
|
||||
'we should return the received data to the calling method': function (oa) {
|
||||
oa._request= function(method, url, headers, post_body, access_token, callback) {
|
||||
callback(null, '{"access_token":"access","refresh_token":"refresh","extra_1":1, "extra_2":"foo"}');
|
||||
};
|
||||
oa.getOAuthAccessToken("", {}, function(error, access_token, refresh_token, results) {
|
||||
assert.equal( access_token, "access");
|
||||
assert.equal( refresh_token, "refresh");
|
||||
assert.isNotNull( results );
|
||||
assert.equal( results.extra_1, 1);
|
||||
assert.equal( results.extra_2, "foo");
|
||||
});
|
||||
}
|
||||
}
|
||||
}).export(module);
|
Loading…
x
Reference in New Issue
Block a user