Permalink
Browse files

Expose raw and parsed JSON response.

  • Loading branch information...
1 parent 4da6bc4 commit bc655b22574071e04a9ae5dba1a6b0ba6c01ad63 @jaredhanson committed Feb 23, 2012
Showing with 19 additions and 1 deletion.
  1. +4 −0 .travis.yml
  2. +3 −1 README.md
  3. +3 −0 lib/passport-yammer/strategy.js
  4. +3 −0 package.json
  5. +6 −0 test/strategy-test.js
View
@@ -0,0 +1,4 @@
+language: "node_js"
+node_js:
+ - 0.4
+ - 0.6
View
@@ -1,7 +1,7 @@
# Passport-Yammer
[Passport](https://github.com/jaredhanson/passport) strategy for authenticating
-with Yammer using the OAuth 2.0 API.
+with [Yammer](https://www.yammer.com/) using the OAuth 2.0 API.
## Installation
@@ -54,6 +54,8 @@ application:
For a complete, working example, refer to the [login example](https://github.com/jaredhanson/passport-yammer/tree/master/examples/login).
+[![Build Status](https://secure.travis-ci.org/jaredhanson/passport-yammer.png)](http://travis-ci.org/jaredhanson/passport-yammer)
+
## Tests
$ npm install --dev
@@ -108,6 +108,9 @@ Strategy.prototype.userProfile = function(accessToken, done) {
profile.id = json.id;
profile.displayName = json.full_name;
+ profile._raw = body;
+ profile._json = json;
+
done(null, profile);
} catch(e) {
done(e);
View
@@ -18,6 +18,9 @@
"devDependencies": {
"vows": "0.6.x"
},
+ "scripts": {
+ "test": "NODE_PATH=lib node_modules/.bin/vows test/*-test.js"
+ },
"engines": { "node": ">= 0.4.0" },
"licenses": [ {
"type": "MIT",
View
@@ -105,6 +105,12 @@ vows.describe('YammerStrategy').addBatch({
assert.equal(profile.id, '4022983');
assert.equal(profile.displayName, 'Ilya Yakubovich');
},
+ 'should set raw property' : function(err, profile) {
+ assert.isString(profile._raw);
+ },
+ 'should set json property' : function(err, profile) {
+ assert.isObject(profile._json);
+ },
},
},

0 comments on commit bc655b2

Please sign in to comment.