{"action":"created","comment":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/53197292","id":53197292,"diff_hunk":"@@ -0,0 +1,124 @@\n+# -*- encoding : utf-8 -*-\n+require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')\n+\n+describe OutgoingMessage::Template::InternalReview do\n+\n+  describe '.details_placeholder' do\n+\n+    it 'returns the internal review placeholder text' do\n+      expect(described_class.details_placeholder).\n+        to eq('GIVE DETAILS ABOUT YOUR COMPLAINT HERE')\n+    end\n+\n+  end\n+\n+  describe '#body' do\n+\n+    it 'requires a :public_body_name key' do\n+      attrs = { :info_request_title => 'a', :url => 'b' }\n+      msg = 'Missing required key: public_body_name'\n+      expect { subject.body(attrs) }.to raise_error(ArgumentError, msg)\n+    end\n+\n+    it 'requires an :info_request_title key' do\n+      attrs = { :public_body_name => 'a', :url => 'b' }\n+      msg = 'Missing required key: info_request_title'\n+      expect { subject.body(attrs) }.to raise_error(ArgumentError, msg)\n+    end\n+\n+    it 'requires a :url key' do\n+      attrs = { :public_body_name => 'a', :info_request_title => 'b' }\n+      msg = 'Missing required key: url'\n+      expect { subject.body(attrs) }.to raise_error(ArgumentError, msg)\n+    end\n+\n+    it 'returns the expected template text' do\n+      attrs = { :public_body_name => 'A body',\n+                :info_request_title => 'a test title',\n+                :url => 'http://test.host/request/a_test_title' }\n+\n+      expected = <<-EOF.strip_heredoc\n+      Dear A body,\n+\n+      Please pass this on to the person who conducts Freedom of Information reviews.\n+\n+      I am writing to request an internal review of A body's handling of my FOI request 'a test title'.\n+\n+\n+\n+       [ GIVE DETAILS ABOUT YOUR COMPLAINT HERE ] \n+\n+\n+\n+      A full history of my FOI request and all correspondence is available on the Internet at this address: http://test.host/request/a_test_title\n+\n+\n+      Yours faithfully,\n+\n+      EOF\n+\n+      expect(subject.body(attrs)).to eq(expected)\n+    end\n+\n+    it 'allows a custom message letter' do\n+      attrs = { :public_body_name => 'A body',\n+                :info_request_title => 'a test title',\n+                :url => 'http://test.host/request/a_test_title',\n+                :letter => 'A custom letter' }\n+      expected = \"Dear A body,\\n\\nA custom letter\\n\\n\\nYours faithfully,\\n\\n\"\n+      expect(subject.body(attrs)).to eq(expected)\n+    end\n+\n+  end\n+\n+  describe '#salutation' do\n+\n+    it 'returns the salutation' do\n+      expect(subject.salutation(:public_body_name => 'A body')).\n+        to eq('Dear A body,')\n+    end\n+\n+  end\n+\n+  describe '#letter' do\n+\n+    it 'returns the letter' do\n+      attrs = { :public_body_name => 'A body',\n+                :info_request_title => 'a test title',\n+                :url => 'http://test.host/request/a_test_title' }\n+\n+      expected = <<-EOF.strip_heredoc\n+\n+\n+      Please pass this on to the person who conducts Freedom of Information reviews.\n+\n+      I am writing to request an internal review of A body's handling of my FOI request 'a test title'.\n+\n+\n+\n+       [ GIVE DETAILS ABOUT YOUR COMPLAINT HERE ] ","path":"spec/models/outgoing_message/template/internal_review_spec.rb","position":99,"original_position":99,"commit_id":"6e92731b47157fb4ffb42d96cc3b14651c93eed3","original_commit_id":"6e92731b47157fb4ffb42d96cc3b14651c93eed3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Trailing whitespace detected.","created_at":"2016-02-17T17:13:06Z","updated_at":"2016-02-17T17:13:06Z","html_url":"https://github.com/mysociety/alaveteli/pull/3045#discussion_r53197292","pull_request_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045","_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments/53197292"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/3045#discussion_r53197292"},"pull_request":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045"}}},"pull_request":{"url":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045","id":58758550,"html_url":"https://github.com/mysociety/alaveteli/pull/3045","diff_url":"https://github.com/mysociety/alaveteli/pull/3045.diff","patch_url":"https://github.com/mysociety/alaveteli/pull/3045.patch","issue_url":"https://api.github.com/repos/mysociety/alaveteli/issues/3045","number":3045,"state":"open","locked":false,"title":"[#2819] OutgoingMessage Templates","user":{"login":"garethrees","id":282788,"avatar_url":"https://avatars.githubusercontent.com/u/282788?v=3","gravatar_id":"","url":"https://api.github.com/users/garethrees","html_url":"https://github.com/garethrees","followers_url":"https://api.github.com/users/garethrees/followers","following_url":"https://api.github.com/users/garethrees/following{/other_user}","gists_url":"https://api.github.com/users/garethrees/gists{/gist_id}","starred_url":"https://api.github.com/users/garethrees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethrees/subscriptions","organizations_url":"https://api.github.com/users/garethrees/orgs","repos_url":"https://api.github.com/users/garethrees/repos","events_url":"https://api.github.com/users/garethrees/events{/privacy}","received_events_url":"https://api.github.com/users/garethrees/received_events","type":"User","site_admin":false},"body":"Work on #2819 \r\n\r\nRefactor the generation of the default letter in to `OutgoingMessage::Template` classes, so that an `OutgoingMessage::Template::ExternalReview` can be added.","created_at":"2016-02-09T15:01:38Z","updated_at":"2016-02-17T17:13:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c012677366d2a88cdd7eee36717a748b423280ed","assignee":{"login":"garethrees","id":282788,"avatar_url":"https://avatars.githubusercontent.com/u/282788?v=3","gravatar_id":"","url":"https://api.github.com/users/garethrees","html_url":"https://github.com/garethrees","followers_url":"https://api.github.com/users/garethrees/followers","following_url":"https://api.github.com/users/garethrees/following{/other_user}","gists_url":"https://api.github.com/users/garethrees/gists{/gist_id}","starred_url":"https://api.github.com/users/garethrees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethrees/subscriptions","organizations_url":"https://api.github.com/users/garethrees/orgs","repos_url":"https://api.github.com/users/garethrees/repos","events_url":"https://api.github.com/users/garethrees/events{/privacy}","received_events_url":"https://api.github.com/users/garethrees/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045/commits","review_comments_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045/comments","review_comment_url":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/issues/3045/comments","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/6e92731b47157fb4ffb42d96cc3b14651c93eed3","head":{"label":"mysociety:2819-outgoing-message-templates","ref":"2819-outgoing-message-templates","sha":"6e92731b47157fb4ffb42d96cc3b14651c93eed3","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","deployments_url":"https://api.github.com/repos/mysociety/alaveteli/deployments","created_at":"2010-11-30T13:11:39Z","updated_at":"2016-02-01T02:31:45Z","pushed_at":"2016-02-17T17:13:00Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":107384,"stargazers_count":164,"watchers_count":164,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":105,"mirror_url":null,"open_issues_count":752,"forks":105,"open_issues":752,"watchers":164,"default_branch":"develop"}},"base":{"label":"mysociety:develop","ref":"develop","sha":"f92e3b16602bd86c22e949205de3738b20da4547","user":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"repo":{"id":1125389,"name":"alaveteli","full_name":"mysociety/alaveteli","owner":{"login":"mysociety","id":141338,"avatar_url":"https://avatars.githubusercontent.com/u/141338?v=3","gravatar_id":"","url":"https://api.github.com/users/mysociety","html_url":"https://github.com/mysociety","followers_url":"https://api.github.com/users/mysociety/followers","following_url":"https://api.github.com/users/mysociety/following{/other_user}","gists_url":"https://api.github.com/users/mysociety/gists{/gist_id}","starred_url":"https://api.github.com/users/mysociety/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysociety/subscriptions","organizations_url":"https://api.github.com/users/mysociety/orgs","repos_url":"https://api.github.com/users/mysociety/repos","events_url":"https://api.github.com/users/mysociety/events{/privacy}","received_events_url":"https://api.github.com/users/mysociety/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysociety/alaveteli","description":"Provide a Freedom of Information request system for your jurisdiction","fork":false,"url":"https://api.github.com/repos/mysociety/alaveteli","forks_url":"https://api.github.com/repos/mysociety/alaveteli/forks","keys_url":"https://api.github.com/repos/mysociety/alaveteli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysociety/alaveteli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysociety/alaveteli/teams","hooks_url":"https://api.github.com/repos/mysociety/alaveteli/hooks","issue_events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/events{/number}","events_url":"https://api.github.com/repos/mysociety/alaveteli/events","assignees_url":"https://api.github.com/repos/mysociety/alaveteli/assignees{/user}","branches_url":"https://api.github.com/repos/mysociety/alaveteli/branches{/branch}","tags_url":"https://api.github.com/repos/mysociety/alaveteli/tags","blobs_url":"https://api.github.com/repos/mysociety/alaveteli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysociety/alaveteli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysociety/alaveteli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysociety/alaveteli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysociety/alaveteli/statuses/{sha}","languages_url":"https://api.github.com/repos/mysociety/alaveteli/languages","stargazers_url":"https://api.github.com/repos/mysociety/alaveteli/stargazers","contributors_url":"https://api.github.com/repos/mysociety/alaveteli/contributors","subscribers_url":"https://api.github.com/repos/mysociety/alaveteli/subscribers","subscription_url":"https://api.github.com/repos/mysociety/alaveteli/subscription","commits_url":"https://api.github.com/repos/mysociety/alaveteli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysociety/alaveteli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysociety/alaveteli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysociety/alaveteli/contents/{+path}","compare_url":"https://api.github.com/repos/mysociety/alaveteli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysociety/alaveteli/merges","archive_url":"https://api.github.com/repos/mysociety/alaveteli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysociety/alaveteli/downloads","issues_url":"https://api.github.com/repos/mysociety/alaveteli/issues{/number}","pulls_url":"https://api.github.com/repos/mysociety/alaveteli/pulls{/number}","milestones_url":"https://api.github.com/repos/mysociety/alaveteli/milestones{/number}","notifications_url":"https://api.github.com/repos/mysociety/alaveteli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysociety/alaveteli/labels{/name}","releases_url":"https://api.github.com/repos/mysociety/alaveteli/releases{/id}","deployments_url":"https://api.github.com/repos/mysociety/alaveteli/deployments","created_at":"2010-11-30T13:11:39Z","updated_at":"2016-02-01T02:31:45Z","pushed_at":"2016-02-17T17:13:00Z","git_url":"git://github.com/mysociety/alaveteli.git","ssh_url":"git@github.com:mysociety/alaveteli.git","clone_url":"https://github.com/mysociety/alaveteli.git","svn_url":"https://github.com/mysociety/alaveteli","homepage":"http://alaveteli.org","size":107384,"stargazers_count":164,"watchers_count":164,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":105,"mirror_url":null,"open_issues_count":752,"forks":105,"open_issues":752,"watchers":164,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045"},"html":{"href":"https://github.com/mysociety/alaveteli/pull/3045"},"issue":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/3045"},"comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/issues/3045/comments"},"review_comments":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045/comments"},"review_comment":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysociety/alaveteli/pulls/3045/commits"},"statuses":{"href":"https://api.github.com/repos/mysociety/alaveteli/statuses/6e92731b47157fb4ffb42d96cc3b14651c93eed3"}}}}