{"action":"created","comment":{"url":"https://api.github.com/repos/ello/ello-ifttt/pulls/comments/55696677","id":55696677,"diff_hunk":"@@ -0,0 +1,90 @@\n+require 'rails_helper'\n+\n+RSpec.describe 'Fetching loved post triggers', type: :request do\n+\n+  let(:response_json) { JSON.parse(response.body) }\n+  let(:jwt_token) do\n+    JWT.encode(jwt_payload,\n+               OpenSSL::PKey::RSA.new(ENV['JWT_PRIVATE_KEY']),\n+               'RS512')\n+  end\n+\n+  let(:jwt_payload) do\n+    {\n+      iss: 'Ello, PBC',\n+      iat: Time.now.to_i,\n+      jti: SecureRandom.hex,\n+      exp: exp.to_i,\n+      data: {\n+        analytics_id: 'abc123',\n+        username: 'archer',\n+        user_id: 1\n+      }\n+    }\n+  end\n+\n+  describe 'with a valid JWT token' do\n+    let(:exp) { 2.hours.from_now }\n+    let(:params) { { limit: 10 } }\n+\n+    let!(:pl1) do\n+      Event.create!(\n+        owner_id: '2',\n+        payload: {\n+          id: 1,\n+          loved_at: 2.hours.ago,\n+          url: 'https://ello.co/lana/posts/1'\n+        },\n+        created_at: 2.hours.ago,\n+        kind: 'post_was_loved',\n+        action_taken_by_id: '1'\n+      )\n+    end\n+    let!(:pl2) do\n+      Event.create!(\n+        owner_id: '3',\n+        payload: { id: 2, loved_at: 1.hour.ago },\n+        created_at: 1.hour.ago,\n+        kind: 'post_was_loved',\n+        action_taken_by_id: '1'\n+      )\n+    end\n+    let!(:pl3) do\n+      Event.create!(\n+        owner_id: '1',\n+        payload: { id: 3, loved_at: 1.hour.ago },\n+        created_at: 1.hour.ago,\n+        kind: 'post_was_loved',\n+        action_taken_by_id: '2'\n+      )\n+    end\n+    let!(:pc3) do\n+      Event.create!(\n+        owner_id: '2',\n+        payload: { id: 3 },\n+        created_at: 1.hour.ago,\n+        kind: 'post_was_created',\n+        action_taken_by_id: '2'\n+      )\n+    end\n+\n+    before do\n+      post '/ifttt/v1/triggers/loved_a_post',\n+        params: params,","path":"spec/request/loved_a_post_spec.rb","position":73,"original_position":73,"commit_id":"53bc05bf7309754f5605875b5ab786d57eef8e98","original_commit_id":"53bc05bf7309754f5605875b5ab786d57eef8e98","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":"Align the parameters of a method call if they span more than one line.","created_at":"2016-03-10T15:34:22Z","updated_at":"2016-03-10T15:34:22Z","html_url":"https://github.com/ello/ello-ifttt/pull/2#discussion_r55696677","pull_request_url":"https://api.github.com/repos/ello/ello-ifttt/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/comments/55696677"},"html":{"href":"https://github.com/ello/ello-ifttt/pull/2#discussion_r55696677"},"pull_request":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/ello/ello-ifttt/pulls/2","id":62287491,"html_url":"https://github.com/ello/ello-ifttt/pull/2","diff_url":"https://github.com/ello/ello-ifttt/pull/2.diff","patch_url":"https://github.com/ello/ello-ifttt/pull/2.patch","issue_url":"https://api.github.com/repos/ello/ello-ifttt/issues/2","number":2,"state":"open","locked":false,"title":"Add basic new post and new love trigger endpoints.","user":{"login":"alanpeabody","id":19368,"avatar_url":"https://avatars.githubusercontent.com/u/19368?v=3","gravatar_id":"","url":"https://api.github.com/users/alanpeabody","html_url":"https://github.com/alanpeabody","followers_url":"https://api.github.com/users/alanpeabody/followers","following_url":"https://api.github.com/users/alanpeabody/following{/other_user}","gists_url":"https://api.github.com/users/alanpeabody/gists{/gist_id}","starred_url":"https://api.github.com/users/alanpeabody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanpeabody/subscriptions","organizations_url":"https://api.github.com/users/alanpeabody/orgs","repos_url":"https://api.github.com/users/alanpeabody/repos","events_url":"https://api.github.com/users/alanpeabody/events{/privacy}","received_events_url":"https://api.github.com/users/alanpeabody/received_events","type":"User","site_admin":false},"body":"/cc @jayzes @Justin-Holmes ","created_at":"2016-03-09T20:05:34Z","updated_at":"2016-03-10T15:34:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea8d70a924045d0bac6ae324e66309815217d4fb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ello/ello-ifttt/pulls/2/commits","review_comments_url":"https://api.github.com/repos/ello/ello-ifttt/pulls/2/comments","review_comment_url":"https://api.github.com/repos/ello/ello-ifttt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ello/ello-ifttt/issues/2/comments","statuses_url":"https://api.github.com/repos/ello/ello-ifttt/statuses/53bc05bf7309754f5605875b5ab786d57eef8e98","head":{"label":"ello:ap-basic-endpoints","ref":"ap-basic-endpoints","sha":"53bc05bf7309754f5605875b5ab786d57eef8e98","user":{"login":"ello","id":9370718,"avatar_url":"https://avatars.githubusercontent.com/u/9370718?v=3","gravatar_id":"","url":"https://api.github.com/users/ello","html_url":"https://github.com/ello","followers_url":"https://api.github.com/users/ello/followers","following_url":"https://api.github.com/users/ello/following{/other_user}","gists_url":"https://api.github.com/users/ello/gists{/gist_id}","starred_url":"https://api.github.com/users/ello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ello/subscriptions","organizations_url":"https://api.github.com/users/ello/orgs","repos_url":"https://api.github.com/users/ello/repos","events_url":"https://api.github.com/users/ello/events{/privacy}","received_events_url":"https://api.github.com/users/ello/received_events","type":"Organization","site_admin":false},"repo":{"id":52909750,"name":"ello-ifttt","full_name":"ello/ello-ifttt","owner":{"login":"ello","id":9370718,"avatar_url":"https://avatars.githubusercontent.com/u/9370718?v=3","gravatar_id":"","url":"https://api.github.com/users/ello","html_url":"https://github.com/ello","followers_url":"https://api.github.com/users/ello/followers","following_url":"https://api.github.com/users/ello/following{/other_user}","gists_url":"https://api.github.com/users/ello/gists{/gist_id}","starred_url":"https://api.github.com/users/ello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ello/subscriptions","organizations_url":"https://api.github.com/users/ello/orgs","repos_url":"https://api.github.com/users/ello/repos","events_url":"https://api.github.com/users/ello/events{/privacy}","received_events_url":"https://api.github.com/users/ello/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ello/ello-ifttt","description":"IFTTT Integration","fork":false,"url":"https://api.github.com/repos/ello/ello-ifttt","forks_url":"https://api.github.com/repos/ello/ello-ifttt/forks","keys_url":"https://api.github.com/repos/ello/ello-ifttt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ello/ello-ifttt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ello/ello-ifttt/teams","hooks_url":"https://api.github.com/repos/ello/ello-ifttt/hooks","issue_events_url":"https://api.github.com/repos/ello/ello-ifttt/issues/events{/number}","events_url":"https://api.github.com/repos/ello/ello-ifttt/events","assignees_url":"https://api.github.com/repos/ello/ello-ifttt/assignees{/user}","branches_url":"https://api.github.com/repos/ello/ello-ifttt/branches{/branch}","tags_url":"https://api.github.com/repos/ello/ello-ifttt/tags","blobs_url":"https://api.github.com/repos/ello/ello-ifttt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ello/ello-ifttt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ello/ello-ifttt/git/refs{/sha}","trees_url":"https://api.github.com/repos/ello/ello-ifttt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ello/ello-ifttt/statuses/{sha}","languages_url":"https://api.github.com/repos/ello/ello-ifttt/languages","stargazers_url":"https://api.github.com/repos/ello/ello-ifttt/stargazers","contributors_url":"https://api.github.com/repos/ello/ello-ifttt/contributors","subscribers_url":"https://api.github.com/repos/ello/ello-ifttt/subscribers","subscription_url":"https://api.github.com/repos/ello/ello-ifttt/subscription","commits_url":"https://api.github.com/repos/ello/ello-ifttt/commits{/sha}","git_commits_url":"https://api.github.com/repos/ello/ello-ifttt/git/commits{/sha}","comments_url":"https://api.github.com/repos/ello/ello-ifttt/comments{/number}","issue_comment_url":"https://api.github.com/repos/ello/ello-ifttt/issues/comments{/number}","contents_url":"https://api.github.com/repos/ello/ello-ifttt/contents/{+path}","compare_url":"https://api.github.com/repos/ello/ello-ifttt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ello/ello-ifttt/merges","archive_url":"https://api.github.com/repos/ello/ello-ifttt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ello/ello-ifttt/downloads","issues_url":"https://api.github.com/repos/ello/ello-ifttt/issues{/number}","pulls_url":"https://api.github.com/repos/ello/ello-ifttt/pulls{/number}","milestones_url":"https://api.github.com/repos/ello/ello-ifttt/milestones{/number}","notifications_url":"https://api.github.com/repos/ello/ello-ifttt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ello/ello-ifttt/labels{/name}","releases_url":"https://api.github.com/repos/ello/ello-ifttt/releases{/id}","deployments_url":"https://api.github.com/repos/ello/ello-ifttt/deployments","created_at":"2016-03-01T21:02:17Z","updated_at":"2016-03-01T21:16:24Z","pushed_at":"2016-03-10T15:34:15Z","git_url":"git://github.com/ello/ello-ifttt.git","ssh_url":"git@github.com:ello/ello-ifttt.git","clone_url":"https://github.com/ello/ello-ifttt.git","svn_url":"https://github.com/ello/ello-ifttt","homepage":null,"size":38,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ello:master","ref":"master","sha":"a7556ac78ec402d2e5b9dc030ee389ee64ec6849","user":{"login":"ello","id":9370718,"avatar_url":"https://avatars.githubusercontent.com/u/9370718?v=3","gravatar_id":"","url":"https://api.github.com/users/ello","html_url":"https://github.com/ello","followers_url":"https://api.github.com/users/ello/followers","following_url":"https://api.github.com/users/ello/following{/other_user}","gists_url":"https://api.github.com/users/ello/gists{/gist_id}","starred_url":"https://api.github.com/users/ello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ello/subscriptions","organizations_url":"https://api.github.com/users/ello/orgs","repos_url":"https://api.github.com/users/ello/repos","events_url":"https://api.github.com/users/ello/events{/privacy}","received_events_url":"https://api.github.com/users/ello/received_events","type":"Organization","site_admin":false},"repo":{"id":52909750,"name":"ello-ifttt","full_name":"ello/ello-ifttt","owner":{"login":"ello","id":9370718,"avatar_url":"https://avatars.githubusercontent.com/u/9370718?v=3","gravatar_id":"","url":"https://api.github.com/users/ello","html_url":"https://github.com/ello","followers_url":"https://api.github.com/users/ello/followers","following_url":"https://api.github.com/users/ello/following{/other_user}","gists_url":"https://api.github.com/users/ello/gists{/gist_id}","starred_url":"https://api.github.com/users/ello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ello/subscriptions","organizations_url":"https://api.github.com/users/ello/orgs","repos_url":"https://api.github.com/users/ello/repos","events_url":"https://api.github.com/users/ello/events{/privacy}","received_events_url":"https://api.github.com/users/ello/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ello/ello-ifttt","description":"IFTTT Integration","fork":false,"url":"https://api.github.com/repos/ello/ello-ifttt","forks_url":"https://api.github.com/repos/ello/ello-ifttt/forks","keys_url":"https://api.github.com/repos/ello/ello-ifttt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ello/ello-ifttt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ello/ello-ifttt/teams","hooks_url":"https://api.github.com/repos/ello/ello-ifttt/hooks","issue_events_url":"https://api.github.com/repos/ello/ello-ifttt/issues/events{/number}","events_url":"https://api.github.com/repos/ello/ello-ifttt/events","assignees_url":"https://api.github.com/repos/ello/ello-ifttt/assignees{/user}","branches_url":"https://api.github.com/repos/ello/ello-ifttt/branches{/branch}","tags_url":"https://api.github.com/repos/ello/ello-ifttt/tags","blobs_url":"https://api.github.com/repos/ello/ello-ifttt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ello/ello-ifttt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ello/ello-ifttt/git/refs{/sha}","trees_url":"https://api.github.com/repos/ello/ello-ifttt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ello/ello-ifttt/statuses/{sha}","languages_url":"https://api.github.com/repos/ello/ello-ifttt/languages","stargazers_url":"https://api.github.com/repos/ello/ello-ifttt/stargazers","contributors_url":"https://api.github.com/repos/ello/ello-ifttt/contributors","subscribers_url":"https://api.github.com/repos/ello/ello-ifttt/subscribers","subscription_url":"https://api.github.com/repos/ello/ello-ifttt/subscription","commits_url":"https://api.github.com/repos/ello/ello-ifttt/commits{/sha}","git_commits_url":"https://api.github.com/repos/ello/ello-ifttt/git/commits{/sha}","comments_url":"https://api.github.com/repos/ello/ello-ifttt/comments{/number}","issue_comment_url":"https://api.github.com/repos/ello/ello-ifttt/issues/comments{/number}","contents_url":"https://api.github.com/repos/ello/ello-ifttt/contents/{+path}","compare_url":"https://api.github.com/repos/ello/ello-ifttt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ello/ello-ifttt/merges","archive_url":"https://api.github.com/repos/ello/ello-ifttt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ello/ello-ifttt/downloads","issues_url":"https://api.github.com/repos/ello/ello-ifttt/issues{/number}","pulls_url":"https://api.github.com/repos/ello/ello-ifttt/pulls{/number}","milestones_url":"https://api.github.com/repos/ello/ello-ifttt/milestones{/number}","notifications_url":"https://api.github.com/repos/ello/ello-ifttt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ello/ello-ifttt/labels{/name}","releases_url":"https://api.github.com/repos/ello/ello-ifttt/releases{/id}","deployments_url":"https://api.github.com/repos/ello/ello-ifttt/deployments","created_at":"2016-03-01T21:02:17Z","updated_at":"2016-03-01T21:16:24Z","pushed_at":"2016-03-10T15:34:15Z","git_url":"git://github.com/ello/ello-ifttt.git","ssh_url":"git@github.com:ello/ello-ifttt.git","clone_url":"https://github.com/ello/ello-ifttt.git","svn_url":"https://github.com/ello/ello-ifttt","homepage":null,"size":38,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/2"},"html":{"href":"https://github.com/ello/ello-ifttt/pull/2"},"issue":{"href":"https://api.github.com/repos/ello/ello-ifttt/issues/2"},"comments":{"href":"https://api.github.com/repos/ello/ello-ifttt/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ello/ello-ifttt/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/ello/ello-ifttt/statuses/53bc05bf7309754f5605875b5ab786d57eef8e98"}}}}