{"action":"created","comment":{"url":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments/71626885","id":71626885,"diff_hunk":"@@ -1,15 +1,17 @@\n var testUtils        = require('../../utils'),\n     should           = require('should'),\n     _                = require('lodash'),\n+    uuid             = require('node-uuid'),\n \n     // Stuff we are testing\n-    NotificationsAPI = require('../../../server/api/notifications');\n+    NotificationsAPI = require('../../../server/api/notifications'),\n+    SettingsAPI      = require('../../../server/api/settings');\n \n describe('Notifications API', function () {\n     // Keep the DB clean\n     before(testUtils.teardown);\n     afterEach(testUtils.teardown);\n-    beforeEach(testUtils.setup('users:roles', 'perms:notification', 'perms:init'));\n+    beforeEach(testUtils.setup('users:roles', 'perms:setting', 'perms:notification', 'perms:init'));","path":"core/test/integration/api/api_notifications_spec.js","position":16,"original_position":16,"commit_id":"2ef1cccadf11e6314b29d7aa3e62885a2eea91ef","original_commit_id":"2ef1cccadf11e6314b29d7aa3e62885a2eea91ef","user":{"login":"acburdine","id":5167581,"avatar_url":"https://avatars.githubusercontent.com/u/5167581?v=3","gravatar_id":"","url":"https://api.github.com/users/acburdine","html_url":"https://github.com/acburdine","followers_url":"https://api.github.com/users/acburdine/followers","following_url":"https://api.github.com/users/acburdine/following{/other_user}","gists_url":"https://api.github.com/users/acburdine/gists{/gist_id}","starred_url":"https://api.github.com/users/acburdine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acburdine/subscriptions","organizations_url":"https://api.github.com/users/acburdine/orgs","repos_url":"https://api.github.com/users/acburdine/repos","events_url":"https://api.github.com/users/acburdine/events{/privacy}","received_events_url":"https://api.github.com/users/acburdine/received_events","type":"User","site_admin":false},"body":"this should be:\r\n\r\n```js\r\nbeforeEach(testUtils.setup('settings', 'users:roles', 'perms:setting', 'perms:notification', 'perms:init'));\r\n```\r\n\r\nThat should initialize the settings correctly.","created_at":"2016-07-20T23:46:25Z","updated_at":"2016-07-20T23:46:25Z","html_url":"https://github.com/TryGhost/Ghost/pull/7077#discussion_r71626885","pull_request_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077","_links":{"self":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments/71626885"},"html":{"href":"https://github.com/TryGhost/Ghost/pull/7077#discussion_r71626885"},"pull_request":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077"}}},"pull_request":{"url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077","id":76649116,"html_url":"https://github.com/TryGhost/Ghost/pull/7077","diff_url":"https://github.com/TryGhost/Ghost/pull/7077.diff","patch_url":"https://github.com/TryGhost/Ghost/pull/7077.patch","issue_url":"https://api.github.com/repos/TryGhost/Ghost/issues/7077","number":7077,"state":"open","locked":false,"title":"[WIP] Support for custom notifications","user":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"body":"closes #5071\r\n\r\nThis PR addresses **Add support for custom messages** section described in [#5071](https://github.com/TryGhost/Ghost/issues/5071). \r\n\r\n(NOTE: The section **Move the \"update available\" notification to the about page** is addressed in a [different PR in Ghost-Admin repo](https://github.com/TryGhost/Ghost-Admin/pull/102))\r\n\r\nAs described in #5071 we wish to send notifications for specific versions of Ghost. These notifications can be dismissed. Once they are dismissed, they are not shown again. For this purpose, UpdateCheck service was upgraded to send responses like so:\r\n\r\n```\r\n{\r\n  \"version\": \"0.5.0\",\r\n  \"next_check\": 1427366737,\r\n  \"messages\": [{\r\n    \"id\": ed9dc38c-73e5-4d72-a741-22b11f6e151a,\r\n    \"version\": \"0.5.x\",\r\n    \"content\": \"<p>Hey there! 0.6 is available, visit <a href=\\\"https://ghost.org/download\\\">Ghost.org</a> to grab your copy now<!/p>\" \r\n  ]}\r\n}\r\n```\r\n\r\nIn the above example, a blog running on Ghost version 0.5.x would display `content` a banner on the top. All other Ghost versions ignore `messages` field.\r\n\r\nTo accomplish this, a new `core` property `seenNotifications` is added to `settings` table.\r\n\r\nIf a responses from UpdateCheck has `messages` property, iterate over them and construct  notifications intended for current version. If a custom notification is dismissed, its uuid is added to `seenNotification` array to prevent showing the same message again.\r\n\r\n## TODO\r\n\r\n- [ ] Test fixtures. `grunt validate` fails with \"Unable to find setting to update: seenNotifications\". However, `grunt test:integration/api/api_notifications_spec.js` and `grunt test:integration/update_check_spec.js` pass.","created_at":"2016-07-07T19:09:49Z","updated_at":"2016-07-20T23:46:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42136d953b7ca9cbe7953fdd641c52c6c01b2c30","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/commits","review_comments_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/comments","review_comment_url":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/issues/7077/comments","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/2ef1cccadf11e6314b29d7aa3e62885a2eea91ef","head":{"label":"vkandy:feature/5670-update-notifications-about-page","ref":"feature/5670-update-notifications-about-page","sha":"2ef1cccadf11e6314b29d7aa3e62885a2eea91ef","user":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"repo":{"id":61318448,"name":"Ghost","full_name":"vkandy/Ghost","owner":{"login":"vkandy","id":77166,"avatar_url":"https://avatars.githubusercontent.com/u/77166?v=3","gravatar_id":"","url":"https://api.github.com/users/vkandy","html_url":"https://github.com/vkandy","followers_url":"https://api.github.com/users/vkandy/followers","following_url":"https://api.github.com/users/vkandy/following{/other_user}","gists_url":"https://api.github.com/users/vkandy/gists{/gist_id}","starred_url":"https://api.github.com/users/vkandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkandy/subscriptions","organizations_url":"https://api.github.com/users/vkandy/orgs","repos_url":"https://api.github.com/users/vkandy/repos","events_url":"https://api.github.com/users/vkandy/events{/privacy}","received_events_url":"https://api.github.com/users/vkandy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vkandy/Ghost","description":"Just a blogging platform","fork":true,"url":"https://api.github.com/repos/vkandy/Ghost","forks_url":"https://api.github.com/repos/vkandy/Ghost/forks","keys_url":"https://api.github.com/repos/vkandy/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vkandy/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vkandy/Ghost/teams","hooks_url":"https://api.github.com/repos/vkandy/Ghost/hooks","issue_events_url":"https://api.github.com/repos/vkandy/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/vkandy/Ghost/events","assignees_url":"https://api.github.com/repos/vkandy/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/vkandy/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/vkandy/Ghost/tags","blobs_url":"https://api.github.com/repos/vkandy/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vkandy/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vkandy/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/vkandy/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vkandy/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/vkandy/Ghost/languages","stargazers_url":"https://api.github.com/repos/vkandy/Ghost/stargazers","contributors_url":"https://api.github.com/repos/vkandy/Ghost/contributors","subscribers_url":"https://api.github.com/repos/vkandy/Ghost/subscribers","subscription_url":"https://api.github.com/repos/vkandy/Ghost/subscription","commits_url":"https://api.github.com/repos/vkandy/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/vkandy/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/vkandy/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/vkandy/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/vkandy/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/vkandy/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vkandy/Ghost/merges","archive_url":"https://api.github.com/repos/vkandy/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vkandy/Ghost/downloads","issues_url":"https://api.github.com/repos/vkandy/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/vkandy/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/vkandy/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/vkandy/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vkandy/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/vkandy/Ghost/releases{/id}","deployments_url":"https://api.github.com/repos/vkandy/Ghost/deployments","created_at":"2016-06-16T18:58:24Z","updated_at":"2016-06-16T18:58:28Z","pushed_at":"2016-07-20T19:57:36Z","git_url":"git://github.com/vkandy/Ghost.git","ssh_url":"git@github.com:vkandy/Ghost.git","clone_url":"https://github.com/vkandy/Ghost.git","svn_url":"https://github.com/vkandy/Ghost","homepage":"https://ghost.org","size":21076,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TryGhost:master","ref":"master","sha":"5e6b952e9067f7ce20be94e414ab9c33610ff34d","user":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"repo":{"id":9852918,"name":"Ghost","full_name":"TryGhost/Ghost","owner":{"login":"TryGhost","id":2178663,"avatar_url":"https://avatars.githubusercontent.com/u/2178663?v=3","gravatar_id":"","url":"https://api.github.com/users/TryGhost","html_url":"https://github.com/TryGhost","followers_url":"https://api.github.com/users/TryGhost/followers","following_url":"https://api.github.com/users/TryGhost/following{/other_user}","gists_url":"https://api.github.com/users/TryGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/TryGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TryGhost/subscriptions","organizations_url":"https://api.github.com/users/TryGhost/orgs","repos_url":"https://api.github.com/users/TryGhost/repos","events_url":"https://api.github.com/users/TryGhost/events{/privacy}","received_events_url":"https://api.github.com/users/TryGhost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TryGhost/Ghost","description":"Just a blogging platform","fork":false,"url":"https://api.github.com/repos/TryGhost/Ghost","forks_url":"https://api.github.com/repos/TryGhost/Ghost/forks","keys_url":"https://api.github.com/repos/TryGhost/Ghost/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TryGhost/Ghost/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TryGhost/Ghost/teams","hooks_url":"https://api.github.com/repos/TryGhost/Ghost/hooks","issue_events_url":"https://api.github.com/repos/TryGhost/Ghost/issues/events{/number}","events_url":"https://api.github.com/repos/TryGhost/Ghost/events","assignees_url":"https://api.github.com/repos/TryGhost/Ghost/assignees{/user}","branches_url":"https://api.github.com/repos/TryGhost/Ghost/branches{/branch}","tags_url":"https://api.github.com/repos/TryGhost/Ghost/tags","blobs_url":"https://api.github.com/repos/TryGhost/Ghost/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TryGhost/Ghost/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TryGhost/Ghost/git/refs{/sha}","trees_url":"https://api.github.com/repos/TryGhost/Ghost/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TryGhost/Ghost/statuses/{sha}","languages_url":"https://api.github.com/repos/TryGhost/Ghost/languages","stargazers_url":"https://api.github.com/repos/TryGhost/Ghost/stargazers","contributors_url":"https://api.github.com/repos/TryGhost/Ghost/contributors","subscribers_url":"https://api.github.com/repos/TryGhost/Ghost/subscribers","subscription_url":"https://api.github.com/repos/TryGhost/Ghost/subscription","commits_url":"https://api.github.com/repos/TryGhost/Ghost/commits{/sha}","git_commits_url":"https://api.github.com/repos/TryGhost/Ghost/git/commits{/sha}","comments_url":"https://api.github.com/repos/TryGhost/Ghost/comments{/number}","issue_comment_url":"https://api.github.com/repos/TryGhost/Ghost/issues/comments{/number}","contents_url":"https://api.github.com/repos/TryGhost/Ghost/contents/{+path}","compare_url":"https://api.github.com/repos/TryGhost/Ghost/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TryGhost/Ghost/merges","archive_url":"https://api.github.com/repos/TryGhost/Ghost/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TryGhost/Ghost/downloads","issues_url":"https://api.github.com/repos/TryGhost/Ghost/issues{/number}","pulls_url":"https://api.github.com/repos/TryGhost/Ghost/pulls{/number}","milestones_url":"https://api.github.com/repos/TryGhost/Ghost/milestones{/number}","notifications_url":"https://api.github.com/repos/TryGhost/Ghost/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TryGhost/Ghost/labels{/name}","releases_url":"https://api.github.com/repos/TryGhost/Ghost/releases{/id}","deployments_url":"https://api.github.com/repos/TryGhost/Ghost/deployments","created_at":"2013-05-04T11:09:13Z","updated_at":"2016-07-20T23:36:22Z","pushed_at":"2016-07-20T20:31:18Z","git_url":"git://github.com/TryGhost/Ghost.git","ssh_url":"git@github.com:TryGhost/Ghost.git","clone_url":"https://github.com/TryGhost/Ghost.git","svn_url":"https://github.com/TryGhost/Ghost","homepage":"https://ghost.org","size":52593,"stargazers_count":20089,"watchers_count":20089,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4882,"mirror_url":null,"open_issues_count":202,"forks":4882,"open_issues":202,"watchers":20089,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077"},"html":{"href":"https://github.com/TryGhost/Ghost/pull/7077"},"issue":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/7077"},"comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/issues/7077/comments"},"review_comments":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/comments"},"review_comment":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TryGhost/Ghost/pulls/7077/commits"},"statuses":{"href":"https://api.github.com/repos/TryGhost/Ghost/statuses/2ef1cccadf11e6314b29d7aa3e62885a2eea91ef"}}}}
{"actor":{"display_login":"acburdine"}}