social tests

This commit is contained in:
Barış Soner Uşaklı
2017-05-23 20:43:09 -04:00
parent b2cef4846c
commit b8cc67dfff
4 changed files with 47 additions and 42 deletions

View File

@@ -391,10 +391,20 @@ describe('Admin Controllers', function () {
});
it('should load /admin/general/social', function (done) {
request(nconf.get('url') + '/api/admin/general/social', { jar: jar, json: true }, function (err, res, body) {
var socketAdmin = require('../src/socket.io/admin');
socketAdmin.social.savePostSharingNetworks({ uid: adminUid }, ['facebook', 'twitter', 'google'], function (err) {
assert.ifError(err);
assert(body);
done();
request(nconf.get('url') + '/api/admin/general/social', { jar: jar, json: true }, function (err, res, body) {
assert.ifError(err);
assert(body);
body = body.posts.map(function (network) {
return network && network.id;
});
assert(body.indexOf('facebook') !== -1);
assert(body.indexOf('twitter') !== -1);
assert(body.indexOf('google') !== -1);
done();
});
});
});