{"action":"created","comment":{"url":"https://api.github.com/repos/storytouch/ep_comments/pulls/comments/209070218","pull_request_review_id":145014792,"id":209070218,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTA3MDIxOA==","diff_hunk":"@@ -249,9 +249,94 @@ describe('create comment API broadcast', function(){\n       });\n     });\n   });\n+})\n+\n+describe('update comments API broadcast', function(){\n+  var padID, commentIdToEdit, socket;\n+  beforeEach(function(done){\n+    createPad(function(err, newPadID) {\n+      if (err) throw err;\n+      padID = newPadID;\n+      socket = io.connect(appUrl + \"/comment\");\n+\n+      createComment(padID, {}, function(err, commentId) {\n+        if(err) throw err;\n+        if(!commentId) throw new Error(\"Comment should had been created\");\n+        commentIdToEdit = commentId;\n+        done();\n+      });\n+    });\n+  });\n+\n+  it('updates the text of the comment', function(done){\n+    var newText = 'comment updated!';\n+    var data = {\n+      padId: padID,\n+      commentId: commentIdToEdit,\n+      commentText: newText,\n+    }\n+\n+    updateCommentAndGetListOfComments(data, socket, function(res){\n+      validateCommentText(res, commentIdToEdit, newText);\n+    }, done);\n+  });\n \n+  context('when comment text is empty', function(){\n+    it('does not save the comment text', function (done) {\n+      var originalCommentText = 'This is a comment';\n+      var newText = '';\n+      var data = {\n+        padId: padID,\n+        commentId: commentIdToEdit,\n+        commentText: newText,\n+      }\n+\n+      updateCommentAndGetListOfComments(data, socket, function(res){\n+        validateCommentText(res, commentIdToEdit, originalCommentText);\n+      }, done);\n+    });\n+  })\n+\n+  context('when it tries to update a comment that does not exists', function(){\n+    it('returns an error', function(done){ // when an error happens the callback returns true\n+      var nonExistentCommentId = 'c-noExist123';\n+      var newText = 'anything';\n+      var data = {\n+        padId: padID,\n+        commentId: nonExistentCommentId,\n+        commentText: newText,\n+      }\n+      updateComment(data, socket, function(error){\n+        if (error !== true) {\n+         throw new Error(\"It should return an error\");","path":"static/tests/backend/specs/api/comments.js","position":63,"original_position":63,"commit_id":"24bc8a34bc19530332fc047fc951eed1d55cf1c2","original_commit_id":"24bc8a34bc19530332fc047fc951eed1d55cf1c2","user":{"login":"lpagliari","id":836386,"node_id":"MDQ6VXNlcjgzNjM4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/836386?v=4","gravatar_id":"","url":"https://api.github.com/users/lpagliari","html_url":"https://github.com/lpagliari","followers_url":"https://api.github.com/users/lpagliari/followers","following_url":"https://api.github.com/users/lpagliari/following{/other_user}","gists_url":"https://api.github.com/users/lpagliari/gists{/gist_id}","starred_url":"https://api.github.com/users/lpagliari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpagliari/subscriptions","organizations_url":"https://api.github.com/users/lpagliari/orgs","repos_url":"https://api.github.com/users/lpagliari/repos","events_url":"https://api.github.com/users/lpagliari/events{/privacy}","received_events_url":"https://api.github.com/users/lpagliari/received_events","type":"User","site_admin":false},"body":"acho que a indentação ficou errada aqui...","created_at":"2018-08-09T20:36:09Z","updated_at":"2018-08-09T20:36:10Z","html_url":"https://github.com/storytouch/ep_comments/pull/35#discussion_r209070218","pull_request_url":"https://api.github.com/repos/storytouch/ep_comments/pulls/35","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/comments/209070218"},"html":{"href":"https://github.com/storytouch/ep_comments/pull/35#discussion_r209070218"},"pull_request":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/storytouch/ep_comments/pulls/35","id":207412861,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NDEyODYx","html_url":"https://github.com/storytouch/ep_comments/pull/35","diff_url":"https://github.com/storytouch/ep_comments/pull/35.diff","patch_url":"https://github.com/storytouch/ep_comments/pull/35.patch","issue_url":"https://api.github.com/repos/storytouch/ep_comments/issues/35","number":35,"state":"open","locked":false,"title":"[fix] Avoid error when try to update a non existent comment","user":{"login":"joassouza","id":4945372,"node_id":"MDQ6VXNlcjQ5NDUzNzI=","avatar_url":"https://avatars2.githubusercontent.com/u/4945372?v=4","gravatar_id":"","url":"https://api.github.com/users/joassouza","html_url":"https://github.com/joassouza","followers_url":"https://api.github.com/users/joassouza/followers","following_url":"https://api.github.com/users/joassouza/following{/other_user}","gists_url":"https://api.github.com/users/joassouza/gists{/gist_id}","starred_url":"https://api.github.com/users/joassouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joassouza/subscriptions","organizations_url":"https://api.github.com/users/joassouza/orgs","repos_url":"https://api.github.com/users/joassouza/repos","events_url":"https://api.github.com/users/joassouza/events{/privacy}","received_events_url":"https://api.github.com/users/joassouza/received_events","type":"User","site_admin":false},"body":"This PR fixes part of the error of [bug](https://trello.com/c/zlcaY8PP/1462-p3-coment%C3%A1rios-coment%C3%A1rio-fantasma)","created_at":"2018-08-09T19:03:33Z","updated_at":"2018-08-09T20:36:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc6dd45c69b953f1f93f010114390b62d2cb0ef2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/storytouch/ep_comments/pulls/35/commits","review_comments_url":"https://api.github.com/repos/storytouch/ep_comments/pulls/35/comments","review_comment_url":"https://api.github.com/repos/storytouch/ep_comments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/storytouch/ep_comments/issues/35/comments","statuses_url":"https://api.github.com/repos/storytouch/ep_comments/statuses/24bc8a34bc19530332fc047fc951eed1d55cf1c2","head":{"label":"storytouch:fix/error-update-comment-text","ref":"fix/error-update-comment-text","sha":"24bc8a34bc19530332fc047fc951eed1d55cf1c2","user":{"login":"storytouch","id":6464228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjQyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6464228?v=4","gravatar_id":"","url":"https://api.github.com/users/storytouch","html_url":"https://github.com/storytouch","followers_url":"https://api.github.com/users/storytouch/followers","following_url":"https://api.github.com/users/storytouch/following{/other_user}","gists_url":"https://api.github.com/users/storytouch/gists{/gist_id}","starred_url":"https://api.github.com/users/storytouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storytouch/subscriptions","organizations_url":"https://api.github.com/users/storytouch/orgs","repos_url":"https://api.github.com/users/storytouch/repos","events_url":"https://api.github.com/users/storytouch/events{/privacy}","received_events_url":"https://api.github.com/users/storytouch/received_events","type":"Organization","site_admin":false},"repo":{"id":37080348,"node_id":"MDEwOlJlcG9zaXRvcnkzNzA4MDM0OA==","name":"ep_comments","full_name":"storytouch/ep_comments","owner":{"login":"storytouch","id":6464228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjQyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6464228?v=4","gravatar_id":"","url":"https://api.github.com/users/storytouch","html_url":"https://github.com/storytouch","followers_url":"https://api.github.com/users/storytouch/followers","following_url":"https://api.github.com/users/storytouch/following{/other_user}","gists_url":"https://api.github.com/users/storytouch/gists{/gist_id}","starred_url":"https://api.github.com/users/storytouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storytouch/subscriptions","organizations_url":"https://api.github.com/users/storytouch/orgs","repos_url":"https://api.github.com/users/storytouch/repos","events_url":"https://api.github.com/users/storytouch/events{/privacy}","received_events_url":"https://api.github.com/users/storytouch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/storytouch/ep_comments","description":"Comments in Etherpad - No Longer Highly Experimental, now highly awesome!","fork":true,"url":"https://api.github.com/repos/storytouch/ep_comments","forks_url":"https://api.github.com/repos/storytouch/ep_comments/forks","keys_url":"https://api.github.com/repos/storytouch/ep_comments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storytouch/ep_comments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storytouch/ep_comments/teams","hooks_url":"https://api.github.com/repos/storytouch/ep_comments/hooks","issue_events_url":"https://api.github.com/repos/storytouch/ep_comments/issues/events{/number}","events_url":"https://api.github.com/repos/storytouch/ep_comments/events","assignees_url":"https://api.github.com/repos/storytouch/ep_comments/assignees{/user}","branches_url":"https://api.github.com/repos/storytouch/ep_comments/branches{/branch}","tags_url":"https://api.github.com/repos/storytouch/ep_comments/tags","blobs_url":"https://api.github.com/repos/storytouch/ep_comments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storytouch/ep_comments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storytouch/ep_comments/git/refs{/sha}","trees_url":"https://api.github.com/repos/storytouch/ep_comments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storytouch/ep_comments/statuses/{sha}","languages_url":"https://api.github.com/repos/storytouch/ep_comments/languages","stargazers_url":"https://api.github.com/repos/storytouch/ep_comments/stargazers","contributors_url":"https://api.github.com/repos/storytouch/ep_comments/contributors","subscribers_url":"https://api.github.com/repos/storytouch/ep_comments/subscribers","subscription_url":"https://api.github.com/repos/storytouch/ep_comments/subscription","commits_url":"https://api.github.com/repos/storytouch/ep_comments/commits{/sha}","git_commits_url":"https://api.github.com/repos/storytouch/ep_comments/git/commits{/sha}","comments_url":"https://api.github.com/repos/storytouch/ep_comments/comments{/number}","issue_comment_url":"https://api.github.com/repos/storytouch/ep_comments/issues/comments{/number}","contents_url":"https://api.github.com/repos/storytouch/ep_comments/contents/{+path}","compare_url":"https://api.github.com/repos/storytouch/ep_comments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storytouch/ep_comments/merges","archive_url":"https://api.github.com/repos/storytouch/ep_comments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storytouch/ep_comments/downloads","issues_url":"https://api.github.com/repos/storytouch/ep_comments/issues{/number}","pulls_url":"https://api.github.com/repos/storytouch/ep_comments/pulls{/number}","milestones_url":"https://api.github.com/repos/storytouch/ep_comments/milestones{/number}","notifications_url":"https://api.github.com/repos/storytouch/ep_comments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storytouch/ep_comments/labels{/name}","releases_url":"https://api.github.com/repos/storytouch/ep_comments/releases{/id}","deployments_url":"https://api.github.com/repos/storytouch/ep_comments/deployments","created_at":"2015-06-08T16:58:52Z","updated_at":"2018-07-27T13:50:02Z","pushed_at":"2018-08-09T20:27:31Z","git_url":"git://github.com/storytouch/ep_comments.git","ssh_url":"git@github.com:storytouch/ep_comments.git","clone_url":"https://github.com/storytouch/ep_comments.git","svn_url":"https://github.com/storytouch/ep_comments","homepage":"","size":663,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master-tk"}},"base":{"label":"storytouch:master-tk","ref":"master-tk","sha":"1ad9615cbc263d532f04b8a68c4762e6363b2ac4","user":{"login":"storytouch","id":6464228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjQyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6464228?v=4","gravatar_id":"","url":"https://api.github.com/users/storytouch","html_url":"https://github.com/storytouch","followers_url":"https://api.github.com/users/storytouch/followers","following_url":"https://api.github.com/users/storytouch/following{/other_user}","gists_url":"https://api.github.com/users/storytouch/gists{/gist_id}","starred_url":"https://api.github.com/users/storytouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storytouch/subscriptions","organizations_url":"https://api.github.com/users/storytouch/orgs","repos_url":"https://api.github.com/users/storytouch/repos","events_url":"https://api.github.com/users/storytouch/events{/privacy}","received_events_url":"https://api.github.com/users/storytouch/received_events","type":"Organization","site_admin":false},"repo":{"id":37080348,"node_id":"MDEwOlJlcG9zaXRvcnkzNzA4MDM0OA==","name":"ep_comments","full_name":"storytouch/ep_comments","owner":{"login":"storytouch","id":6464228,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjQyMjg=","avatar_url":"https://avatars1.githubusercontent.com/u/6464228?v=4","gravatar_id":"","url":"https://api.github.com/users/storytouch","html_url":"https://github.com/storytouch","followers_url":"https://api.github.com/users/storytouch/followers","following_url":"https://api.github.com/users/storytouch/following{/other_user}","gists_url":"https://api.github.com/users/storytouch/gists{/gist_id}","starred_url":"https://api.github.com/users/storytouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storytouch/subscriptions","organizations_url":"https://api.github.com/users/storytouch/orgs","repos_url":"https://api.github.com/users/storytouch/repos","events_url":"https://api.github.com/users/storytouch/events{/privacy}","received_events_url":"https://api.github.com/users/storytouch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/storytouch/ep_comments","description":"Comments in Etherpad - No Longer Highly Experimental, now highly awesome!","fork":true,"url":"https://api.github.com/repos/storytouch/ep_comments","forks_url":"https://api.github.com/repos/storytouch/ep_comments/forks","keys_url":"https://api.github.com/repos/storytouch/ep_comments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/storytouch/ep_comments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/storytouch/ep_comments/teams","hooks_url":"https://api.github.com/repos/storytouch/ep_comments/hooks","issue_events_url":"https://api.github.com/repos/storytouch/ep_comments/issues/events{/number}","events_url":"https://api.github.com/repos/storytouch/ep_comments/events","assignees_url":"https://api.github.com/repos/storytouch/ep_comments/assignees{/user}","branches_url":"https://api.github.com/repos/storytouch/ep_comments/branches{/branch}","tags_url":"https://api.github.com/repos/storytouch/ep_comments/tags","blobs_url":"https://api.github.com/repos/storytouch/ep_comments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/storytouch/ep_comments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/storytouch/ep_comments/git/refs{/sha}","trees_url":"https://api.github.com/repos/storytouch/ep_comments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/storytouch/ep_comments/statuses/{sha}","languages_url":"https://api.github.com/repos/storytouch/ep_comments/languages","stargazers_url":"https://api.github.com/repos/storytouch/ep_comments/stargazers","contributors_url":"https://api.github.com/repos/storytouch/ep_comments/contributors","subscribers_url":"https://api.github.com/repos/storytouch/ep_comments/subscribers","subscription_url":"https://api.github.com/repos/storytouch/ep_comments/subscription","commits_url":"https://api.github.com/repos/storytouch/ep_comments/commits{/sha}","git_commits_url":"https://api.github.com/repos/storytouch/ep_comments/git/commits{/sha}","comments_url":"https://api.github.com/repos/storytouch/ep_comments/comments{/number}","issue_comment_url":"https://api.github.com/repos/storytouch/ep_comments/issues/comments{/number}","contents_url":"https://api.github.com/repos/storytouch/ep_comments/contents/{+path}","compare_url":"https://api.github.com/repos/storytouch/ep_comments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/storytouch/ep_comments/merges","archive_url":"https://api.github.com/repos/storytouch/ep_comments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/storytouch/ep_comments/downloads","issues_url":"https://api.github.com/repos/storytouch/ep_comments/issues{/number}","pulls_url":"https://api.github.com/repos/storytouch/ep_comments/pulls{/number}","milestones_url":"https://api.github.com/repos/storytouch/ep_comments/milestones{/number}","notifications_url":"https://api.github.com/repos/storytouch/ep_comments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/storytouch/ep_comments/labels{/name}","releases_url":"https://api.github.com/repos/storytouch/ep_comments/releases{/id}","deployments_url":"https://api.github.com/repos/storytouch/ep_comments/deployments","created_at":"2015-06-08T16:58:52Z","updated_at":"2018-07-27T13:50:02Z","pushed_at":"2018-08-09T20:27:31Z","git_url":"git://github.com/storytouch/ep_comments.git","ssh_url":"git@github.com:storytouch/ep_comments.git","clone_url":"https://github.com/storytouch/ep_comments.git","svn_url":"https://github.com/storytouch/ep_comments","homepage":"","size":663,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master-tk"}},"_links":{"self":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/35"},"html":{"href":"https://github.com/storytouch/ep_comments/pull/35"},"issue":{"href":"https://api.github.com/repos/storytouch/ep_comments/issues/35"},"comments":{"href":"https://api.github.com/repos/storytouch/ep_comments/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/storytouch/ep_comments/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/storytouch/ep_comments/statuses/24bc8a34bc19530332fc047fc951eed1d55cf1c2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lpagliari"}}