{"action":"created","comment":{"url":"https://api.github.com/repos/meanjs/mean/pulls/comments/38297554","id":38297554,"diff_hunk":"@@ -3,6 +3,117 @@\n /**\n  * Chat socket tests\n  */\n-describe('Chat Socket Tests:', function () {\n-  // TODO: Add chat socket tests\n+\n+var should = require('should'),\n+  request = require('supertest'),\n+  path = require('path'),\n+  mongoose = require('mongoose'),\n+  sinon = require('sinon'),\n+  User = mongoose.model('User'),\n+  express = require(path.resolve('./config/lib/express')),\n+  io = require('socket.io/node_modules/socket.io-client');\n+\n+/**\n+ * Globals\n+ */\n+var app, agent, credentials, ioc, user, admin, sessionId, clock;\n+\n+describe('Socket Chat tests:', function() {\n+\n+  // Get application\n+  before(function(done) {\n+    app = express.init(mongoose);\n+    agent = request.agent(app);\n+\n+    done();\n+  });\n+\n+  // create the user\n+  beforeEach(function(done) {\n+    // Create user credentials\n+    credentials = {\n+      username: 'username',\n+      password: 'password'\n+    };\n+\n+    // Create a new user\n+    user = new User({\n+      firstName: 'Full',\n+      lastName: 'Name',\n+      displayName: 'Full Name',\n+      email: 'test@test.com',\n+      username: credentials.username,\n+      password: credentials.password,\n+      provider: 'local'\n+    });\n+\n+    // Save a user to the test db\n+    user.save(function () {\n+      done();\n+    });\n+  });\n+\n+  it('should be able to connect on socket', function(done) {\n+    clock = sinon.useFakeTimers(Date.now());","path":"modules/chat/tests/server/chat.socket.tests.js","position":57,"original_position":57,"commit_id":"bdabca116df184acdff69ba5ea1dfcbdc846157d","original_commit_id":"bdabca116df184acdff69ba5ea1dfcbdc846157d","user":{"login":"bastianwegge","id":1541474,"avatar_url":"https://avatars.githubusercontent.com/u/1541474?v=3","gravatar_id":"","url":"https://api.github.com/users/bastianwegge","html_url":"https://github.com/bastianwegge","followers_url":"https://api.github.com/users/bastianwegge/followers","following_url":"https://api.github.com/users/bastianwegge/following{/other_user}","gists_url":"https://api.github.com/users/bastianwegge/gists{/gist_id}","starred_url":"https://api.github.com/users/bastianwegge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastianwegge/subscriptions","organizations_url":"https://api.github.com/users/bastianwegge/orgs","repos_url":"https://api.github.com/users/bastianwegge/repos","events_url":"https://api.github.com/users/bastianwegge/events{/privacy}","received_events_url":"https://api.github.com/users/bastianwegge/received_events","type":"User","site_admin":false},"body":"Added `sinon.useFakeTimers` as we should use it anyway when testing. In 1 or 10 cases my tests fail because of some latency. Maybe we can shift to this when testing objects where time is just on of the attributes.","created_at":"2015-08-31T09:44:07Z","updated_at":"2015-08-31T09:44:07Z","html_url":"https://github.com/meanjs/mean/pull/865#discussion_r38297554","pull_request_url":"https://api.github.com/repos/meanjs/mean/pulls/865","_links":{"self":{"href":"https://api.github.com/repos/meanjs/mean/pulls/comments/38297554"},"html":{"href":"https://github.com/meanjs/mean/pull/865#discussion_r38297554"},"pull_request":{"href":"https://api.github.com/repos/meanjs/mean/pulls/865"}}},"pull_request":{"url":"https://api.github.com/repos/meanjs/mean/pulls/865","id":43747213,"html_url":"https://github.com/meanjs/mean/pull/865","diff_url":"https://github.com/meanjs/mean/pull/865.diff","patch_url":"https://github.com/meanjs/mean/pull/865.patch","issue_url":"https://api.github.com/repos/meanjs/mean/issues/865","number":865,"state":"open","locked":false,"title":"Socket.io Testing","user":{"login":"bastianwegge","id":1541474,"avatar_url":"https://avatars.githubusercontent.com/u/1541474?v=3","gravatar_id":"","url":"https://api.github.com/users/bastianwegge","html_url":"https://github.com/bastianwegge","followers_url":"https://api.github.com/users/bastianwegge/followers","following_url":"https://api.github.com/users/bastianwegge/following{/other_user}","gists_url":"https://api.github.com/users/bastianwegge/gists{/gist_id}","starred_url":"https://api.github.com/users/bastianwegge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastianwegge/subscriptions","organizations_url":"https://api.github.com/users/bastianwegge/orgs","repos_url":"https://api.github.com/users/bastianwegge/repos","events_url":"https://api.github.com/users/bastianwegge/events{/privacy}","received_events_url":"https://api.github.com/users/bastianwegge/received_events","type":"User","site_admin":false},"body":"Hey guys, just wanted to share something that's actually working for me. I worked with @mleanos over the weekend on this. The Automattic/socket.io in the package.json links to the latest socket.io Library, which does seem to have one or more bugfixes which makes the `extraHeaders` work.\r\n\r\n@codydaig @rhutchison @lirantal \r\n\r\n! This is work-in-progress !","created_at":"2015-08-31T09:36:22Z","updated_at":"2015-08-31T09:44:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8757ab3664700ddcec015017ec75c680516d336e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/meanjs/mean/pulls/865/commits","review_comments_url":"https://api.github.com/repos/meanjs/mean/pulls/865/comments","review_comment_url":"https://api.github.com/repos/meanjs/mean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meanjs/mean/issues/865/comments","statuses_url":"https://api.github.com/repos/meanjs/mean/statuses/bdabca116df184acdff69ba5ea1dfcbdc846157d","head":{"label":"bastianwegge:master","ref":"master","sha":"bdabca116df184acdff69ba5ea1dfcbdc846157d","user":{"login":"bastianwegge","id":1541474,"avatar_url":"https://avatars.githubusercontent.com/u/1541474?v=3","gravatar_id":"","url":"https://api.github.com/users/bastianwegge","html_url":"https://github.com/bastianwegge","followers_url":"https://api.github.com/users/bastianwegge/followers","following_url":"https://api.github.com/users/bastianwegge/following{/other_user}","gists_url":"https://api.github.com/users/bastianwegge/gists{/gist_id}","starred_url":"https://api.github.com/users/bastianwegge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastianwegge/subscriptions","organizations_url":"https://api.github.com/users/bastianwegge/orgs","repos_url":"https://api.github.com/users/bastianwegge/repos","events_url":"https://api.github.com/users/bastianwegge/events{/privacy}","received_events_url":"https://api.github.com/users/bastianwegge/received_events","type":"User","site_admin":false},"repo":{"id":41661707,"name":"mean","full_name":"bastianwegge/mean","owner":{"login":"bastianwegge","id":1541474,"avatar_url":"https://avatars.githubusercontent.com/u/1541474?v=3","gravatar_id":"","url":"https://api.github.com/users/bastianwegge","html_url":"https://github.com/bastianwegge","followers_url":"https://api.github.com/users/bastianwegge/followers","following_url":"https://api.github.com/users/bastianwegge/following{/other_user}","gists_url":"https://api.github.com/users/bastianwegge/gists{/gist_id}","starred_url":"https://api.github.com/users/bastianwegge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastianwegge/subscriptions","organizations_url":"https://api.github.com/users/bastianwegge/orgs","repos_url":"https://api.github.com/users/bastianwegge/repos","events_url":"https://api.github.com/users/bastianwegge/events{/privacy}","received_events_url":"https://api.github.com/users/bastianwegge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bastianwegge/mean","description":"MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js - ","fork":true,"url":"https://api.github.com/repos/bastianwegge/mean","forks_url":"https://api.github.com/repos/bastianwegge/mean/forks","keys_url":"https://api.github.com/repos/bastianwegge/mean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bastianwegge/mean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bastianwegge/mean/teams","hooks_url":"https://api.github.com/repos/bastianwegge/mean/hooks","issue_events_url":"https://api.github.com/repos/bastianwegge/mean/issues/events{/number}","events_url":"https://api.github.com/repos/bastianwegge/mean/events","assignees_url":"https://api.github.com/repos/bastianwegge/mean/assignees{/user}","branches_url":"https://api.github.com/repos/bastianwegge/mean/branches{/branch}","tags_url":"https://api.github.com/repos/bastianwegge/mean/tags","blobs_url":"https://api.github.com/repos/bastianwegge/mean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bastianwegge/mean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bastianwegge/mean/git/refs{/sha}","trees_url":"https://api.github.com/repos/bastianwegge/mean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bastianwegge/mean/statuses/{sha}","languages_url":"https://api.github.com/repos/bastianwegge/mean/languages","stargazers_url":"https://api.github.com/repos/bastianwegge/mean/stargazers","contributors_url":"https://api.github.com/repos/bastianwegge/mean/contributors","subscribers_url":"https://api.github.com/repos/bastianwegge/mean/subscribers","subscription_url":"https://api.github.com/repos/bastianwegge/mean/subscription","commits_url":"https://api.github.com/repos/bastianwegge/mean/commits{/sha}","git_commits_url":"https://api.github.com/repos/bastianwegge/mean/git/commits{/sha}","comments_url":"https://api.github.com/repos/bastianwegge/mean/comments{/number}","issue_comment_url":"https://api.github.com/repos/bastianwegge/mean/issues/comments{/number}","contents_url":"https://api.github.com/repos/bastianwegge/mean/contents/{+path}","compare_url":"https://api.github.com/repos/bastianwegge/mean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bastianwegge/mean/merges","archive_url":"https://api.github.com/repos/bastianwegge/mean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bastianwegge/mean/downloads","issues_url":"https://api.github.com/repos/bastianwegge/mean/issues{/number}","pulls_url":"https://api.github.com/repos/bastianwegge/mean/pulls{/number}","milestones_url":"https://api.github.com/repos/bastianwegge/mean/milestones{/number}","notifications_url":"https://api.github.com/repos/bastianwegge/mean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bastianwegge/mean/labels{/name}","releases_url":"https://api.github.com/repos/bastianwegge/mean/releases{/id}","created_at":"2015-08-31T07:23:51Z","updated_at":"2015-08-31T07:23:51Z","pushed_at":"2015-08-31T09:41:49Z","git_url":"git://github.com/bastianwegge/mean.git","ssh_url":"git@github.com:bastianwegge/mean.git","clone_url":"https://github.com/bastianwegge/mean.git","svn_url":"https://github.com/bastianwegge/mean","homepage":"http://meanjs.org","size":7622,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"meanjs:master","ref":"master","sha":"16b481fa2e46088398d4a96b9808aacc149072a7","user":{"login":"meanjs","id":6232122,"avatar_url":"https://avatars.githubusercontent.com/u/6232122?v=3","gravatar_id":"","url":"https://api.github.com/users/meanjs","html_url":"https://github.com/meanjs","followers_url":"https://api.github.com/users/meanjs/followers","following_url":"https://api.github.com/users/meanjs/following{/other_user}","gists_url":"https://api.github.com/users/meanjs/gists{/gist_id}","starred_url":"https://api.github.com/users/meanjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meanjs/subscriptions","organizations_url":"https://api.github.com/users/meanjs/orgs","repos_url":"https://api.github.com/users/meanjs/repos","events_url":"https://api.github.com/users/meanjs/events{/privacy}","received_events_url":"https://api.github.com/users/meanjs/received_events","type":"Organization","site_admin":false},"repo":{"id":15508537,"name":"mean","full_name":"meanjs/mean","owner":{"login":"meanjs","id":6232122,"avatar_url":"https://avatars.githubusercontent.com/u/6232122?v=3","gravatar_id":"","url":"https://api.github.com/users/meanjs","html_url":"https://github.com/meanjs","followers_url":"https://api.github.com/users/meanjs/followers","following_url":"https://api.github.com/users/meanjs/following{/other_user}","gists_url":"https://api.github.com/users/meanjs/gists{/gist_id}","starred_url":"https://api.github.com/users/meanjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meanjs/subscriptions","organizations_url":"https://api.github.com/users/meanjs/orgs","repos_url":"https://api.github.com/users/meanjs/repos","events_url":"https://api.github.com/users/meanjs/events{/privacy}","received_events_url":"https://api.github.com/users/meanjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/meanjs/mean","description":"MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js - ","fork":false,"url":"https://api.github.com/repos/meanjs/mean","forks_url":"https://api.github.com/repos/meanjs/mean/forks","keys_url":"https://api.github.com/repos/meanjs/mean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meanjs/mean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meanjs/mean/teams","hooks_url":"https://api.github.com/repos/meanjs/mean/hooks","issue_events_url":"https://api.github.com/repos/meanjs/mean/issues/events{/number}","events_url":"https://api.github.com/repos/meanjs/mean/events","assignees_url":"https://api.github.com/repos/meanjs/mean/assignees{/user}","branches_url":"https://api.github.com/repos/meanjs/mean/branches{/branch}","tags_url":"https://api.github.com/repos/meanjs/mean/tags","blobs_url":"https://api.github.com/repos/meanjs/mean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meanjs/mean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meanjs/mean/git/refs{/sha}","trees_url":"https://api.github.com/repos/meanjs/mean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meanjs/mean/statuses/{sha}","languages_url":"https://api.github.com/repos/meanjs/mean/languages","stargazers_url":"https://api.github.com/repos/meanjs/mean/stargazers","contributors_url":"https://api.github.com/repos/meanjs/mean/contributors","subscribers_url":"https://api.github.com/repos/meanjs/mean/subscribers","subscription_url":"https://api.github.com/repos/meanjs/mean/subscription","commits_url":"https://api.github.com/repos/meanjs/mean/commits{/sha}","git_commits_url":"https://api.github.com/repos/meanjs/mean/git/commits{/sha}","comments_url":"https://api.github.com/repos/meanjs/mean/comments{/number}","issue_comment_url":"https://api.github.com/repos/meanjs/mean/issues/comments{/number}","contents_url":"https://api.github.com/repos/meanjs/mean/contents/{+path}","compare_url":"https://api.github.com/repos/meanjs/mean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meanjs/mean/merges","archive_url":"https://api.github.com/repos/meanjs/mean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meanjs/mean/downloads","issues_url":"https://api.github.com/repos/meanjs/mean/issues{/number}","pulls_url":"https://api.github.com/repos/meanjs/mean/pulls{/number}","milestones_url":"https://api.github.com/repos/meanjs/mean/milestones{/number}","notifications_url":"https://api.github.com/repos/meanjs/mean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meanjs/mean/labels{/name}","releases_url":"https://api.github.com/repos/meanjs/mean/releases{/id}","created_at":"2013-12-29T13:01:15Z","updated_at":"2015-08-31T03:02:13Z","pushed_at":"2015-08-31T09:41:51Z","git_url":"git://github.com/meanjs/mean.git","ssh_url":"git@github.com:meanjs/mean.git","clone_url":"https://github.com/meanjs/mean.git","svn_url":"https://github.com/meanjs/mean","homepage":"http://meanjs.org","size":7622,"stargazers_count":2503,"watchers_count":2503,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":889,"mirror_url":null,"open_issues_count":71,"forks":889,"open_issues":71,"watchers":2503,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meanjs/mean/pulls/865"},"html":{"href":"https://github.com/meanjs/mean/pull/865"},"issue":{"href":"https://api.github.com/repos/meanjs/mean/issues/865"},"comments":{"href":"https://api.github.com/repos/meanjs/mean/issues/865/comments"},"review_comments":{"href":"https://api.github.com/repos/meanjs/mean/pulls/865/comments"},"review_comment":{"href":"https://api.github.com/repos/meanjs/mean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meanjs/mean/pulls/865/commits"},"statuses":{"href":"https://api.github.com/repos/meanjs/mean/statuses/bdabca116df184acdff69ba5ea1dfcbdc846157d"}}}}