forked from jaredhanson/passport-facebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.test.js
42 lines (33 loc) · 1.16 KB
/
profile.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var fs = require('fs')
, parse = require('../lib/profile').parse;
describe('profile.parse', function() {
describe('picture field', function() {
var profile;
before(function(done) {
fs.readFile('test/data/picture.json', 'utf8', function(err, data) {
if (err) { return done(err); }
profile = parse(data);
done();
});
});
it('should parse profile', function() {
expect(profile.photos).to.have.length(1);
expect(profile.photos[0].value).to.equal('http://profile.ak.fbcdn.net/hprofile-ak-prn1/example.jpg');
expect(profile.emails).to.be.undefined;
});
});
describe('picture field, October 2012 breaking changes', function() {
var profile;
before(function(done) {
fs.readFile('test/data/picture-2012-10.json', 'utf8', function(err, data) {
if (err) { return done(err); }
profile = parse(data);
done();
});
});
it('should parse profile', function() {
expect(profile.photos).to.have.length(1);
expect(profile.photos[0].value).to.equal('http://profile.ak.fbcdn.net/hprofile-ak-prn1/example.jpg');
});
});
});