Added support for GET when requesting request tokens

This commit is contained in:
Raoul Millais
2011-08-16 13:26:49 +01:00
parent a2ac03bc37
commit 1b4624cacd
2 changed files with 19 additions and 1 deletions

View File

@ -133,6 +133,19 @@ vows.describe('OAuth').addBatch({
assert.equal( oa.signUrl("http://somehost.com:3323/foo/poop?bar=foo", "token", "tokensecret"), "http://somehost.com:3323/foo/poop?bar=foo&oauth_consumer_key=consumerkey&oauth_nonce=ybHPeOEkAUJ3k2wJT9Xb43MjtSgTvKqp&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1272399856&oauth_token=token&oauth_version=1.0&oauth_signature=zeOR0Wsm6EG6XSg0Vw%2FsbpoSib8%3D");
}
},
'When getting a request token': {
topic: function() {
var oa= new OAuth(null, null, "consumerkey", "consumersecret", "1.0", null, "HMAC-SHA1");
oa._getTimestamp= function(){ return "1272399856"; }
oa._getNonce= function(){ return "ybHPeOEkAUJ3k2wJT9Xb43MjtSgTvKqp"; }
oa._performSecureRequest= function(){ return this.requestArguments = arguments; }
return oa;
},
'Use the provided HTTP method': function(oa) {
oa.getOAuthRequestToken(function() {}, "GET");
assert.equal(oa.requestArguments[2], "GET");
}
},
'When get authorization header' : {
topic: function() {
var oa= new OAuth(null, null, "consumerkey", "consumersecret", "1.0", null, "HMAC-SHA1");