{"action":"created","comment":{"url":"https://api.github.com/repos/discourse/discourse-assign/pulls/comments/279257689","pull_request_review_id":231541043,"id":279257689,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI3OTI1NzY4OQ==","diff_hunk":"@@ -0,0 +1,61 @@\n+require 'rails_helper'\n+\n+RSpec.describe PendingAssignsReminder do\n+  let(:user) { Fabricate(:user) }\n+\n+  it 'Do not create a reminder if the user has 0 assigned topics' do\n+    assert_reminder_not_created\n+  end\n+\n+  it 'Do not create a reminder if the user only has one task' do\n+    post = Fabricate(:post)\n+    TopicAssigner.new(post.topic, user).assign(user)\n+\n+    assert_reminder_not_created\n+  end\n+\n+  def assert_reminder_not_created\n+    expect { subject.remind(user) }.to change { Post.count }.by(0)\n+  end\n+\n+  describe 'When the user has multiple tasks' do\n+    let(:system) { Discourse.system_user }\n+\n+    before do\n+      @post = Fabricate(:post)\n+      @another_post = Fabricate(:post)\n+      TopicAssigner.new(@post.topic, user).assign(user)\n+      TopicAssigner.new(@another_post.topic, user).assign(user)\n+      @assigned_posts = 2\n+    end\n+\n+    it 'Creates a reminder for a particular user' do\n+      subject.remind(user)\n+\n+      created_post = Post.includes(topic: %i[topic_allowed_users]).last\n+\n+      assert_remind_was_created_correctly(created_post.topic, created_post)","path":"spec/lib/pending_assigns_reminder_spec.rb","position":37,"original_position":37,"commit_id":"4d8042f502fe8d1bfdc8bd1fc6eafb2626d4c8c8","original_commit_id":"4d8042f502fe8d1bfdc8bd1fc6eafb2626d4c8c8","user":{"login":"tgxworld","id":4335742,"node_id":"MDQ6VXNlcjQzMzU3NDI=","avatar_url":"https://avatars3.githubusercontent.com/u/4335742?v=4","gravatar_id":"","url":"https://api.github.com/users/tgxworld","html_url":"https://github.com/tgxworld","followers_url":"https://api.github.com/users/tgxworld/followers","following_url":"https://api.github.com/users/tgxworld/following{/other_user}","gists_url":"https://api.github.com/users/tgxworld/gists{/gist_id}","starred_url":"https://api.github.com/users/tgxworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgxworld/subscriptions","organizations_url":"https://api.github.com/users/tgxworld/orgs","repos_url":"https://api.github.com/users/tgxworld/repos","events_url":"https://api.github.com/users/tgxworld/events{/privacy}","received_events_url":"https://api.github.com/users/tgxworld/received_events","type":"User","site_admin":false},"body":"Minor but we can just pass in the post here and have the method pick out the topic.","created_at":"2019-04-29T07:29:28Z","updated_at":"2019-04-29T07:29:28Z","html_url":"https://github.com/discourse/discourse-assign/pull/28#discussion_r279257689","pull_request_url":"https://api.github.com/repos/discourse/discourse-assign/pulls/28","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/comments/279257689"},"html":{"href":"https://github.com/discourse/discourse-assign/pull/28#discussion_r279257689"},"pull_request":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/discourse/discourse-assign/pulls/28","id":272511836,"node_id":"MDExOlB1bGxSZXF1ZXN0MjcyNTExODM2","html_url":"https://github.com/discourse/discourse-assign/pull/28","diff_url":"https://github.com/discourse/discourse-assign/pull/28.diff","patch_url":"https://github.com/discourse/discourse-assign/pull/28.patch","issue_url":"https://api.github.com/repos/discourse/discourse-assign/issues/28","number":28,"state":"open","locked":false,"title":"FEATURE: Remind users of assigned tasks.","user":{"login":"romanrizzi","id":5025816,"node_id":"MDQ6VXNlcjUwMjU4MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/5025816?v=4","gravatar_id":"","url":"https://api.github.com/users/romanrizzi","html_url":"https://github.com/romanrizzi","followers_url":"https://api.github.com/users/romanrizzi/followers","following_url":"https://api.github.com/users/romanrizzi/following{/other_user}","gists_url":"https://api.github.com/users/romanrizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/romanrizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romanrizzi/subscriptions","organizations_url":"https://api.github.com/users/romanrizzi/orgs","repos_url":"https://api.github.com/users/romanrizzi/repos","events_url":"https://api.github.com/users/romanrizzi/events{/privacy}","received_events_url":"https://api.github.com/users/romanrizzi/received_events","type":"User","site_admin":false},"body":"### Changes\r\n\r\n- New `SiteSetting` to set reminders frequency.\r\n- Sends a PM as a reminder of assigned tasks:\r\n  - Only if `tasks >= 1`.\r\n\r\n![Screen Shot 2019-04-17 at 10 10 05](https://user-images.githubusercontent.com/5025816/56532748-c6d00a00-652c-11e9-8153-53c87d541843.png)\r\n![Screen Shot 2019-04-17 at 10 22 33](https://user-images.githubusercontent.com/5025816/56532769-d0597200-652c-11e9-982b-1aae064a338c.png)\r\n","created_at":"2019-04-22T21:32:30Z","updated_at":"2019-04-29T07:29:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc37f2bf40ec83d86f1c99f9cdd02176172cfb0e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/discourse/discourse-assign/pulls/28/commits","review_comments_url":"https://api.github.com/repos/discourse/discourse-assign/pulls/28/comments","review_comment_url":"https://api.github.com/repos/discourse/discourse-assign/pulls/comments{/number}","comments_url":"https://api.github.com/repos/discourse/discourse-assign/issues/28/comments","statuses_url":"https://api.github.com/repos/discourse/discourse-assign/statuses/4d8042f502fe8d1bfdc8bd1fc6eafb2626d4c8c8","head":{"label":"discourse:remind_users_of_assigned_tasks","ref":"remind_users_of_assigned_tasks","sha":"4d8042f502fe8d1bfdc8bd1fc6eafb2626d4c8c8","user":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"repo":{"id":80773376,"node_id":"MDEwOlJlcG9zaXRvcnk4MDc3MzM3Ng==","name":"discourse-assign","full_name":"discourse/discourse-assign","private":false,"owner":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/discourse/discourse-assign","description":"Plugin for assigning users to a topic","fork":false,"url":"https://api.github.com/repos/discourse/discourse-assign","forks_url":"https://api.github.com/repos/discourse/discourse-assign/forks","keys_url":"https://api.github.com/repos/discourse/discourse-assign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discourse/discourse-assign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discourse/discourse-assign/teams","hooks_url":"https://api.github.com/repos/discourse/discourse-assign/hooks","issue_events_url":"https://api.github.com/repos/discourse/discourse-assign/issues/events{/number}","events_url":"https://api.github.com/repos/discourse/discourse-assign/events","assignees_url":"https://api.github.com/repos/discourse/discourse-assign/assignees{/user}","branches_url":"https://api.github.com/repos/discourse/discourse-assign/branches{/branch}","tags_url":"https://api.github.com/repos/discourse/discourse-assign/tags","blobs_url":"https://api.github.com/repos/discourse/discourse-assign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discourse/discourse-assign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discourse/discourse-assign/git/refs{/sha}","trees_url":"https://api.github.com/repos/discourse/discourse-assign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discourse/discourse-assign/statuses/{sha}","languages_url":"https://api.github.com/repos/discourse/discourse-assign/languages","stargazers_url":"https://api.github.com/repos/discourse/discourse-assign/stargazers","contributors_url":"https://api.github.com/repos/discourse/discourse-assign/contributors","subscribers_url":"https://api.github.com/repos/discourse/discourse-assign/subscribers","subscription_url":"https://api.github.com/repos/discourse/discourse-assign/subscription","commits_url":"https://api.github.com/repos/discourse/discourse-assign/commits{/sha}","git_commits_url":"https://api.github.com/repos/discourse/discourse-assign/git/commits{/sha}","comments_url":"https://api.github.com/repos/discourse/discourse-assign/comments{/number}","issue_comment_url":"https://api.github.com/repos/discourse/discourse-assign/issues/comments{/number}","contents_url":"https://api.github.com/repos/discourse/discourse-assign/contents/{+path}","compare_url":"https://api.github.com/repos/discourse/discourse-assign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discourse/discourse-assign/merges","archive_url":"https://api.github.com/repos/discourse/discourse-assign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discourse/discourse-assign/downloads","issues_url":"https://api.github.com/repos/discourse/discourse-assign/issues{/number}","pulls_url":"https://api.github.com/repos/discourse/discourse-assign/pulls{/number}","milestones_url":"https://api.github.com/repos/discourse/discourse-assign/milestones{/number}","notifications_url":"https://api.github.com/repos/discourse/discourse-assign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discourse/discourse-assign/labels{/name}","releases_url":"https://api.github.com/repos/discourse/discourse-assign/releases{/id}","deployments_url":"https://api.github.com/repos/discourse/discourse-assign/deployments","created_at":"2017-02-02T22:07:38Z","updated_at":"2019-04-19T17:57:18Z","pushed_at":"2019-04-26T20:03:24Z","git_url":"git://github.com/discourse/discourse-assign.git","ssh_url":"git@github.com:discourse/discourse-assign.git","clone_url":"https://github.com/discourse/discourse-assign.git","svn_url":"https://github.com/discourse/discourse-assign","homepage":null,"size":250,"stargazers_count":19,"watchers_count":19,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":4,"license":null,"forks":17,"open_issues":4,"watchers":19,"default_branch":"master"}},"base":{"label":"discourse:master","ref":"master","sha":"4625108888db7ee0bfa3773ba97c0237e550c32a","user":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"repo":{"id":80773376,"node_id":"MDEwOlJlcG9zaXRvcnk4MDc3MzM3Ng==","name":"discourse-assign","full_name":"discourse/discourse-assign","private":false,"owner":{"login":"discourse","id":3220138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyMjAxMzg=","avatar_url":"https://avatars2.githubusercontent.com/u/3220138?v=4","gravatar_id":"","url":"https://api.github.com/users/discourse","html_url":"https://github.com/discourse","followers_url":"https://api.github.com/users/discourse/followers","following_url":"https://api.github.com/users/discourse/following{/other_user}","gists_url":"https://api.github.com/users/discourse/gists{/gist_id}","starred_url":"https://api.github.com/users/discourse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discourse/subscriptions","organizations_url":"https://api.github.com/users/discourse/orgs","repos_url":"https://api.github.com/users/discourse/repos","events_url":"https://api.github.com/users/discourse/events{/privacy}","received_events_url":"https://api.github.com/users/discourse/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/discourse/discourse-assign","description":"Plugin for assigning users to a topic","fork":false,"url":"https://api.github.com/repos/discourse/discourse-assign","forks_url":"https://api.github.com/repos/discourse/discourse-assign/forks","keys_url":"https://api.github.com/repos/discourse/discourse-assign/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discourse/discourse-assign/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discourse/discourse-assign/teams","hooks_url":"https://api.github.com/repos/discourse/discourse-assign/hooks","issue_events_url":"https://api.github.com/repos/discourse/discourse-assign/issues/events{/number}","events_url":"https://api.github.com/repos/discourse/discourse-assign/events","assignees_url":"https://api.github.com/repos/discourse/discourse-assign/assignees{/user}","branches_url":"https://api.github.com/repos/discourse/discourse-assign/branches{/branch}","tags_url":"https://api.github.com/repos/discourse/discourse-assign/tags","blobs_url":"https://api.github.com/repos/discourse/discourse-assign/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discourse/discourse-assign/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discourse/discourse-assign/git/refs{/sha}","trees_url":"https://api.github.com/repos/discourse/discourse-assign/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discourse/discourse-assign/statuses/{sha}","languages_url":"https://api.github.com/repos/discourse/discourse-assign/languages","stargazers_url":"https://api.github.com/repos/discourse/discourse-assign/stargazers","contributors_url":"https://api.github.com/repos/discourse/discourse-assign/contributors","subscribers_url":"https://api.github.com/repos/discourse/discourse-assign/subscribers","subscription_url":"https://api.github.com/repos/discourse/discourse-assign/subscription","commits_url":"https://api.github.com/repos/discourse/discourse-assign/commits{/sha}","git_commits_url":"https://api.github.com/repos/discourse/discourse-assign/git/commits{/sha}","comments_url":"https://api.github.com/repos/discourse/discourse-assign/comments{/number}","issue_comment_url":"https://api.github.com/repos/discourse/discourse-assign/issues/comments{/number}","contents_url":"https://api.github.com/repos/discourse/discourse-assign/contents/{+path}","compare_url":"https://api.github.com/repos/discourse/discourse-assign/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discourse/discourse-assign/merges","archive_url":"https://api.github.com/repos/discourse/discourse-assign/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discourse/discourse-assign/downloads","issues_url":"https://api.github.com/repos/discourse/discourse-assign/issues{/number}","pulls_url":"https://api.github.com/repos/discourse/discourse-assign/pulls{/number}","milestones_url":"https://api.github.com/repos/discourse/discourse-assign/milestones{/number}","notifications_url":"https://api.github.com/repos/discourse/discourse-assign/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discourse/discourse-assign/labels{/name}","releases_url":"https://api.github.com/repos/discourse/discourse-assign/releases{/id}","deployments_url":"https://api.github.com/repos/discourse/discourse-assign/deployments","created_at":"2017-02-02T22:07:38Z","updated_at":"2019-04-19T17:57:18Z","pushed_at":"2019-04-26T20:03:24Z","git_url":"git://github.com/discourse/discourse-assign.git","ssh_url":"git@github.com:discourse/discourse-assign.git","clone_url":"https://github.com/discourse/discourse-assign.git","svn_url":"https://github.com/discourse/discourse-assign","homepage":null,"size":250,"stargazers_count":19,"watchers_count":19,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":4,"license":null,"forks":17,"open_issues":4,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/28"},"html":{"href":"https://github.com/discourse/discourse-assign/pull/28"},"issue":{"href":"https://api.github.com/repos/discourse/discourse-assign/issues/28"},"comments":{"href":"https://api.github.com/repos/discourse/discourse-assign/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/discourse/discourse-assign/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/discourse/discourse-assign/statuses/4d8042f502fe8d1bfdc8bd1fc6eafb2626d4c8c8"}},"author_association":"NONE"}}
{"actor":{"display_login":"tgxworld"}}