Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e52e51
commit 8a6c4a5
Showing
5 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"sub": "111111111111111111111", | ||
"name": "Jared Hanson", | ||
"given_name": "Jared", | ||
"family_name": "Hanson", | ||
"picture": "https://lh3.googleusercontent.com/-XxXXxxXxXXX/AAAAAAAAAAI/AAAAAAAAAAA/0000xxxxx0X/photo.jpg", | ||
"locale": "en" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
var Profile = require('../../lib/profile/openid') | ||
, fs = require('fs') | ||
|
||
|
||
describe('OpenIDProfile.parse', function() { | ||
|
||
describe('profile with profile scope', function() { | ||
var profile; | ||
|
||
before(function(done) { | ||
fs.readFile('test/fixtures/userinfo/userinfo-with-profile.json', 'utf8', function(err, data) { | ||
if (err) { return done(err); } | ||
profile = Profile.parse(data); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should parse profile', function() { | ||
expect(profile.id).to.equal('111111111111111111111'); | ||
expect(profile.displayName).to.equal('Jared Hanson'); | ||
expect(profile.name.familyName).to.equal('Hanson'); | ||
expect(profile.name.givenName).to.equal('Jared'); | ||
expect(profile.photos).to.have.length(1); | ||
expect(profile.emails).to.be.undefined; | ||
expect(profile.photos[0].value).to.equal('https://lh3.googleusercontent.com/-XxXXxxXxXXX/AAAAAAAAAAI/AAAAAAAAAAA/0000xxxxx0X/photo.jpg'); | ||
}); | ||
}); | ||
|
||
}); |