3 var social = require('./social');
4 var assert = require('assert');
6 describe('social', function() {
7 it('generates a twitter share url', function() {
8 var url = social.generateTwitterShareUrl('owner/room');
11 'https://twitter.com/share?text=Join%20the%20chat%20room%20on%20Gitter%20for%20owner%2Froom%3A&url=https://gitter.im/owner/room&related=gitchat&via=gitchat'
15 it('throws if it cant generate a twitter share url', function() {
18 social.generateTwitterShareUrl();
23 assert(expected, 'error expected');
26 it('generates a facebook share url', function() {
27 var url = social.generateFacebookShareUrl('owner/room');
28 assert.equal(url, 'http://www.facebook.com/sharer/sharer.php?u=https://gitter.im/owner/room');
31 it('throws if it cant generate a facebook share url', function() {
34 social.generateFacebookShareUrl();
39 assert(expected, 'error expected');
42 it('generates a linkedin share url', function() {
43 var url = social.generateLinkedinShareUrl('owner/room');
46 'https://www.linkedin.com/shareArticle?mini=true&url=https://gitter.im/owner/room&title=owner%2Froom%20on%20Gitter&summary=Join%20the%20chat%20room%20on%20Gitter%20for%20owner%2Froom&source=Gitter'
50 it('throws if it cant generate a linkedin share url', function() {
53 social.generateLinkedinShareUrl();
58 assert(expected, 'error expected');
61 it('generates a google plus share url', function() {
62 var url = social.generateGooglePlusShareUrl('owner/room');
63 assert.equal(url, 'https://plus.google.com/share?url=https://gitter.im/owner/room');
66 it('throws if it cant generate a google plus share url', function() {
69 social.generateGooglePlusShareUrl();
74 assert(expected, 'error expected');