{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/comments/57172483","id":57172483,"diff_hunk":"@@ -0,0 +1,26 @@\n+require 'rails_helper'\n+\n+RSpec.describe GuideTaggerJob do\n+  let(:api_double) { double(:publishing_api) }\n+\n+  before do\n+    stub_const(\"PUBLISHING_API\", api_double)\n+  end\n+\n+  describe \"#batch_perform_later\" do\n+    it \"adds the topic to all guides\" do\n+      topic = create(:topic, :with_some_guides)\n+      guide_ids = topic.tree.map {|t| t[\"guides\"]}.flatten\n+      guide_content_ids = Guide.where(id: guide_ids).pluck(:content_id)\n+      guide_content_ids.each do |guide_content_id|\n+        expect(api_double).to receive(:patch_links)\n+          .with(\n+            guide_content_id,\n+            links: { topics: [topic.content_id] },\n+          )\n+      end\n+\n+      GuideTaggerJob.batch_perform_later(topic)\n+    end\n+  end\n+end","path":"spec/models/guide_tagger_job_spec.rb","position":26,"original_position":26,"commit_id":"1affb2ae9327f07625dc6dc9076929d75f9ed1de","original_commit_id":"1affb2ae9327f07625dc6dc9076929d75f9ed1de","user":{"login":"thehenster","id":78311,"avatar_url":"https://avatars.githubusercontent.com/u/78311?v=3","gravatar_id":"","url":"https://api.github.com/users/thehenster","html_url":"https://github.com/thehenster","followers_url":"https://api.github.com/users/thehenster/followers","following_url":"https://api.github.com/users/thehenster/following{/other_user}","gists_url":"https://api.github.com/users/thehenster/gists{/gist_id}","starred_url":"https://api.github.com/users/thehenster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thehenster/subscriptions","organizations_url":"https://api.github.com/users/thehenster/orgs","repos_url":"https://api.github.com/users/thehenster/repos","events_url":"https://api.github.com/users/thehenster/events{/privacy}","received_events_url":"https://api.github.com/users/thehenster/received_events","type":"User","site_admin":false},"body":"Good work adding this :clap:","created_at":"2016-03-23T14:52:53Z","updated_at":"2016-03-23T14:52:53Z","html_url":"https://github.com/alphagov/service-manual-publisher/pull/204#discussion_r57172483","pull_request_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204","_links":{"self":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/comments/57172483"},"html":{"href":"https://github.com/alphagov/service-manual-publisher/pull/204#discussion_r57172483"},"pull_request":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204","id":63754774,"html_url":"https://github.com/alphagov/service-manual-publisher/pull/204","diff_url":"https://github.com/alphagov/service-manual-publisher/pull/204.diff","patch_url":"https://github.com/alphagov/service-manual-publisher/pull/204.patch","issue_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/204","number":204,"state":"open","locked":false,"title":"Fix bug where we were not sending topics to the correct content items","user":{"login":"AndrewVos","id":363618,"avatar_url":"https://avatars.githubusercontent.com/u/363618?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewVos","html_url":"https://github.com/AndrewVos","followers_url":"https://api.github.com/users/AndrewVos/followers","following_url":"https://api.github.com/users/AndrewVos/following{/other_user}","gists_url":"https://api.github.com/users/AndrewVos/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewVos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewVos/subscriptions","organizations_url":"https://api.github.com/users/AndrewVos/orgs","repos_url":"https://api.github.com/users/AndrewVos/repos","events_url":"https://api.github.com/users/AndrewVos/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewVos/received_events","type":"User","site_admin":false},"body":"~~Don't merge, because this needs tests and need to fix the bug in the `publishing-api` if possible.~~\r\nAlso, turns out if you pass an incorrect ID through to `patch_links`,\r\nyou get a 200.","created_at":"2016-03-22T16:56:43Z","updated_at":"2016-03-23T14:52:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41f5f54684c3e5488aaec59fb3fd5ab520066c54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204/commits","review_comments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204/comments","review_comment_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/204/comments","statuses_url":"https://api.github.com/repos/alphagov/service-manual-publisher/statuses/1affb2ae9327f07625dc6dc9076929d75f9ed1de","head":{"label":"alphagov:fix-communities-not-showing-topics","ref":"fix-communities-not-showing-topics","sha":"1affb2ae9327f07625dc6dc9076929d75f9ed1de","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":43757023,"name":"service-manual-publisher","full_name":"alphagov/service-manual-publisher","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/service-manual-publisher","description":"Create and manage content for the service manual","fork":false,"url":"https://api.github.com/repos/alphagov/service-manual-publisher","forks_url":"https://api.github.com/repos/alphagov/service-manual-publisher/forks","keys_url":"https://api.github.com/repos/alphagov/service-manual-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/service-manual-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/service-manual-publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/service-manual-publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/service-manual-publisher/events","assignees_url":"https://api.github.com/repos/alphagov/service-manual-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/service-manual-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/service-manual-publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/service-manual-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/service-manual-publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/service-manual-publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/service-manual-publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/service-manual-publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/service-manual-publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/service-manual-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/service-manual-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/service-manual-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/service-manual-publisher/merges","archive_url":"https://api.github.com/repos/alphagov/service-manual-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/service-manual-publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/service-manual-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/service-manual-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/service-manual-publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/service-manual-publisher/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/deployments","created_at":"2015-10-06T14:45:26Z","updated_at":"2016-01-22T00:56:21Z","pushed_at":"2016-03-23T14:42:20Z","git_url":"git://github.com/alphagov/service-manual-publisher.git","ssh_url":"git@github.com:alphagov/service-manual-publisher.git","clone_url":"https://github.com/alphagov/service-manual-publisher.git","svn_url":"https://github.com/alphagov/service-manual-publisher","homepage":null,"size":847,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"f4ff37da70f244976fa852b8b45a650822d0926f","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":43757023,"name":"service-manual-publisher","full_name":"alphagov/service-manual-publisher","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/service-manual-publisher","description":"Create and manage content for the service manual","fork":false,"url":"https://api.github.com/repos/alphagov/service-manual-publisher","forks_url":"https://api.github.com/repos/alphagov/service-manual-publisher/forks","keys_url":"https://api.github.com/repos/alphagov/service-manual-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/service-manual-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/service-manual-publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/service-manual-publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/service-manual-publisher/events","assignees_url":"https://api.github.com/repos/alphagov/service-manual-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/service-manual-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/service-manual-publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/service-manual-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/service-manual-publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/service-manual-publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/service-manual-publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/service-manual-publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/service-manual-publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/service-manual-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/service-manual-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/service-manual-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/service-manual-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/service-manual-publisher/merges","archive_url":"https://api.github.com/repos/alphagov/service-manual-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/service-manual-publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/service-manual-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/service-manual-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/service-manual-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/service-manual-publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/service-manual-publisher/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/service-manual-publisher/deployments","created_at":"2015-10-06T14:45:26Z","updated_at":"2016-01-22T00:56:21Z","pushed_at":"2016-03-23T14:42:20Z","git_url":"git://github.com/alphagov/service-manual-publisher.git","ssh_url":"git@github.com:alphagov/service-manual-publisher.git","clone_url":"https://github.com/alphagov/service-manual-publisher.git","svn_url":"https://github.com/alphagov/service-manual-publisher","homepage":null,"size":847,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204"},"html":{"href":"https://github.com/alphagov/service-manual-publisher/pull/204"},"issue":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/204"},"comments":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/service-manual-publisher/statuses/1affb2ae9327f07625dc6dc9076929d75f9ed1de"}}}}