-
Notifications
You must be signed in to change notification settings - Fork 547
/
Copy pathmodules.js
75 lines (59 loc) · 1.96 KB
/
modules.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import errorResponse from '../libs/errorResponse';
import '../../../src/modules/box';
import '../../../src/modules/facebook';
import '../../../src/modules/flickr';
import '../../../src/modules/google';
import '../../../src/modules/windows';
import '../../../src/modules/dropbox';
import '../../../src/modules/twitter';
import '../../../src/modules/yahoo';
import '../../../src/modules/instagram';
import '../../../src/modules/joinme';
import '../../../src/modules/linkedin';
import '../../../src/modules/foursquare';
import '../../../src/modules/github';
import '../../../src/modules/bikeindex';
import '../../../src/modules/soundcloud';
import '../../../src/modules/vk';
describe('E2E modules', function() {
// Loop through all services
for (var name in hello.services) {
setupModuleTests(hello.services[name], name);
}
function setupModuleTests(module, name) {
describe(name, function() {
var MATCH_URL = /^https?\:\/\//;
it('should contain oauth.auth path', function() {
var path = module.oauth.auth;
expect(path).to.match(/^https?\:\/\//);
});
it('should specify a base url', function() {
// Loop through all services
expect(module.base).to.match(/^https?\:\/\//);
});
it('should be using OAuth1 contain, auth, request, token properties', function() {
// Loop through all services
var oauth = module.oauth;
if (oauth && parseInt(oauth.version, 10) === 1) {
expect(oauth.auth).to.match(MATCH_URL);
expect(oauth.token).to.match(MATCH_URL);
expect(oauth.request).to.match(MATCH_URL);
}
});
xit('should return error object when an api request is made with an unverified user', function(done) {
var i = 0;
this.timeout(60000);
var cb = errorResponse(null, function() {
if (++i === 2)
done();
});
// Ensure user is signed out
hello.logout(name);
// Make a request that returns an error object
hello(name)
.api('me', cb)
.then(null, cb);
});
});
}
});