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
| var should = require('should'),
request = require('request'),
qs = require('querystring'),
zlib = require('zlib');
describe('Qiupu APIs: /qiupu', function() {
before(function() {
});
describe('/app/all', function() {
before(function() {
});
it('show all apps.', function(done) {
request.get({
url: 'http://api.borqs.com/qiupu/app/all',
encoding: null,
headers: { 'accept-encoding': 'gzip,deflate'}
}, function(err, resp, body) {
resp.should.be.ok;
resp.should.have.header('content-encoding', 'gzip');
zlib.unzip(body, function(err, buffer) {
should.not.exist(err);
should.exist(buffer);
var json = JSON.parse(buffer);
json.should.not.be.empty;
json.should.be.an.instanceof(Array);
json[0].should.have.property('package');
json[0].should.have.property('app_name');
json[0].should.have.property('app_liked_users')
.and.be.an.instanceof(Array);
done();
});
});
});
});
});
|