{"action":"created","comment":{"url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/comments/126127394","pull_request_review_id":48583464,"id":126127394,"diff_hunk":"@@ -0,0 +1,27 @@\n+require 'spec_helper'\n+\n+RSpec.describe 'Fb::Page#insights' do\n+  context 'given an invalid user access token' do\n+    user = Fb::User.new 'invalid_token'\n+    page = Fb::Page.new({\"name\"=>\"test\", \"id\"=>\"1234\", \"user\"=>user})\n+\n+    it 'raises Fb::Error' do\n+      expect{page.insights}.to raise_error Fb::Error\n+    end\n+  end\n+\n+  context 'given a valid user access token and an existing Facebook page' do\n+    user = Fb::User.new ENV['FB_TEST_ACCESS_TOKEN']\n+    page = Fb::Page.new({\"name\" => \"Games\",\n+      \"id\" => \"872965469547237\",\n+      \"user\" => user})\n+\n+    it 'returns an array of metrics' do\n+      expect(page.insights).to be_a(Array)","path":"spec/pages/insights_spec.rb","position":20,"original_position":20,"commit_id":"ee7caa56dab38c8d569bb058940de7a4818a2c22","original_commit_id":"ee7caa56dab38c8d569bb058940de7a4818a2c22","user":{"login":"claudiofullscreen","id":7408595,"avatar_url":"https://avatars3.githubusercontent.com/u/7408595?v=3","gravatar_id":"","url":"https://api.github.com/users/claudiofullscreen","html_url":"https://github.com/claudiofullscreen","followers_url":"https://api.github.com/users/claudiofullscreen/followers","following_url":"https://api.github.com/users/claudiofullscreen/following{/other_user}","gists_url":"https://api.github.com/users/claudiofullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/claudiofullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudiofullscreen/subscriptions","organizations_url":"https://api.github.com/users/claudiofullscreen/orgs","repos_url":"https://api.github.com/users/claudiofullscreen/repos","events_url":"https://api.github.com/users/claudiofullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/claudiofullscreen/received_events","type":"User","site_admin":false},"body":"@S1v4 Something else that could be interested to test is whether the order in which insights are returned by Facebook is the same in which metrics are provided. In other words if we ask for\r\n\r\n```\r\npage_views_total,page_fan_adds_unique,page_engaged_users,page_video_views\r\n```\r\n\r\ndoes that mean that the insights are returned exactly in that order?\r\n\r\nIf that's the case, then we should add a test, so we can rely on that order.\r\nOtherwise, we would have to find a way to associate the resulting values with the metrics we asked for.\r\n","created_at":"2017-07-07T11:39:29Z","updated_at":"2017-07-07T11:39:29Z","html_url":"https://github.com/Fullscreen/fb-auth/pull/13#discussion_r126127394","pull_request_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/comments/126127394"},"html":{"href":"https://github.com/Fullscreen/fb-auth/pull/13#discussion_r126127394"},"pull_request":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13","id":129279162,"html_url":"https://github.com/Fullscreen/fb-auth/pull/13","diff_url":"https://github.com/Fullscreen/fb-auth/pull/13.diff","patch_url":"https://github.com/Fullscreen/fb-auth/pull/13.patch","issue_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/13","number":13,"state":"open","locked":false,"title":"New gem feature to fetch page insights.","user":{"login":"S1v4","id":15009110,"avatar_url":"https://avatars0.githubusercontent.com/u/15009110?v=3","gravatar_id":"","url":"https://api.github.com/users/S1v4","html_url":"https://github.com/S1v4","followers_url":"https://api.github.com/users/S1v4/followers","following_url":"https://api.github.com/users/S1v4/following{/other_user}","gists_url":"https://api.github.com/users/S1v4/gists{/gist_id}","starred_url":"https://api.github.com/users/S1v4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/S1v4/subscriptions","organizations_url":"https://api.github.com/users/S1v4/orgs","repos_url":"https://api.github.com/users/S1v4/repos","events_url":"https://api.github.com/users/S1v4/events{/privacy}","received_events_url":"https://api.github.com/users/S1v4/received_events","type":"User","site_admin":false},"body":"Fb::Page#insights allows users to fetch the title, description, and value\r\non a set of predefined insights. Request parameters (period, since, until)\r\nare also predefined and will be implemented as optional parameters in a later patch.","created_at":"2017-07-06T20:54:50Z","updated_at":"2017-07-07T11:39:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5827a279f8d844c78a79a911db4fcf8a91c71144","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13/commits","review_comments_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13/comments","review_comment_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/13/comments","statuses_url":"https://api.github.com/repos/Fullscreen/fb-auth/statuses/ee7caa56dab38c8d569bb058940de7a4818a2c22","head":{"label":"Fullscreen:metrics","ref":"metrics","sha":"ee7caa56dab38c8d569bb058940de7a4818a2c22","user":{"login":"Fullscreen","id":682200,"avatar_url":"https://avatars3.githubusercontent.com/u/682200?v=3","gravatar_id":"","url":"https://api.github.com/users/Fullscreen","html_url":"https://github.com/Fullscreen","followers_url":"https://api.github.com/users/Fullscreen/followers","following_url":"https://api.github.com/users/Fullscreen/following{/other_user}","gists_url":"https://api.github.com/users/Fullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/Fullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fullscreen/subscriptions","organizations_url":"https://api.github.com/users/Fullscreen/orgs","repos_url":"https://api.github.com/users/Fullscreen/repos","events_url":"https://api.github.com/users/Fullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/Fullscreen/received_events","type":"Organization","site_admin":false},"repo":{"id":94933316,"name":"fb-auth","full_name":"Fullscreen/fb-auth","owner":{"login":"Fullscreen","id":682200,"avatar_url":"https://avatars3.githubusercontent.com/u/682200?v=3","gravatar_id":"","url":"https://api.github.com/users/Fullscreen","html_url":"https://github.com/Fullscreen","followers_url":"https://api.github.com/users/Fullscreen/followers","following_url":"https://api.github.com/users/Fullscreen/following{/other_user}","gists_url":"https://api.github.com/users/Fullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/Fullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fullscreen/subscriptions","organizations_url":"https://api.github.com/users/Fullscreen/orgs","repos_url":"https://api.github.com/users/Fullscreen/repos","events_url":"https://api.github.com/users/Fullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/Fullscreen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Fullscreen/fb-auth","description":"Authenticate users with their Facebook account","fork":false,"url":"https://api.github.com/repos/Fullscreen/fb-auth","forks_url":"https://api.github.com/repos/Fullscreen/fb-auth/forks","keys_url":"https://api.github.com/repos/Fullscreen/fb-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fullscreen/fb-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fullscreen/fb-auth/teams","hooks_url":"https://api.github.com/repos/Fullscreen/fb-auth/hooks","issue_events_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Fullscreen/fb-auth/events","assignees_url":"https://api.github.com/repos/Fullscreen/fb-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Fullscreen/fb-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Fullscreen/fb-auth/tags","blobs_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fullscreen/fb-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Fullscreen/fb-auth/languages","stargazers_url":"https://api.github.com/repos/Fullscreen/fb-auth/stargazers","contributors_url":"https://api.github.com/repos/Fullscreen/fb-auth/contributors","subscribers_url":"https://api.github.com/repos/Fullscreen/fb-auth/subscribers","subscription_url":"https://api.github.com/repos/Fullscreen/fb-auth/subscription","commits_url":"https://api.github.com/repos/Fullscreen/fb-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fullscreen/fb-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fullscreen/fb-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Fullscreen/fb-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fullscreen/fb-auth/merges","archive_url":"https://api.github.com/repos/Fullscreen/fb-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fullscreen/fb-auth/downloads","issues_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Fullscreen/fb-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Fullscreen/fb-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fullscreen/fb-auth/labels{/name}","releases_url":"https://api.github.com/repos/Fullscreen/fb-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Fullscreen/fb-auth/deployments","created_at":"2017-06-20T20:41:55Z","updated_at":"2017-06-22T21:43:54Z","pushed_at":"2017-07-06T20:54:50Z","git_url":"git://github.com/Fullscreen/fb-auth.git","ssh_url":"git@github.com:Fullscreen/fb-auth.git","clone_url":"https://github.com/Fullscreen/fb-auth.git","svn_url":"https://github.com/Fullscreen/fb-auth","homepage":null,"size":33,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"Fullscreen:master","ref":"master","sha":"1a43f3503ca1bd9332f19f6a31fd61fab973ab8c","user":{"login":"Fullscreen","id":682200,"avatar_url":"https://avatars3.githubusercontent.com/u/682200?v=3","gravatar_id":"","url":"https://api.github.com/users/Fullscreen","html_url":"https://github.com/Fullscreen","followers_url":"https://api.github.com/users/Fullscreen/followers","following_url":"https://api.github.com/users/Fullscreen/following{/other_user}","gists_url":"https://api.github.com/users/Fullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/Fullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fullscreen/subscriptions","organizations_url":"https://api.github.com/users/Fullscreen/orgs","repos_url":"https://api.github.com/users/Fullscreen/repos","events_url":"https://api.github.com/users/Fullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/Fullscreen/received_events","type":"Organization","site_admin":false},"repo":{"id":94933316,"name":"fb-auth","full_name":"Fullscreen/fb-auth","owner":{"login":"Fullscreen","id":682200,"avatar_url":"https://avatars3.githubusercontent.com/u/682200?v=3","gravatar_id":"","url":"https://api.github.com/users/Fullscreen","html_url":"https://github.com/Fullscreen","followers_url":"https://api.github.com/users/Fullscreen/followers","following_url":"https://api.github.com/users/Fullscreen/following{/other_user}","gists_url":"https://api.github.com/users/Fullscreen/gists{/gist_id}","starred_url":"https://api.github.com/users/Fullscreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fullscreen/subscriptions","organizations_url":"https://api.github.com/users/Fullscreen/orgs","repos_url":"https://api.github.com/users/Fullscreen/repos","events_url":"https://api.github.com/users/Fullscreen/events{/privacy}","received_events_url":"https://api.github.com/users/Fullscreen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Fullscreen/fb-auth","description":"Authenticate users with their Facebook account","fork":false,"url":"https://api.github.com/repos/Fullscreen/fb-auth","forks_url":"https://api.github.com/repos/Fullscreen/fb-auth/forks","keys_url":"https://api.github.com/repos/Fullscreen/fb-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fullscreen/fb-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fullscreen/fb-auth/teams","hooks_url":"https://api.github.com/repos/Fullscreen/fb-auth/hooks","issue_events_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/events{/number}","events_url":"https://api.github.com/repos/Fullscreen/fb-auth/events","assignees_url":"https://api.github.com/repos/Fullscreen/fb-auth/assignees{/user}","branches_url":"https://api.github.com/repos/Fullscreen/fb-auth/branches{/branch}","tags_url":"https://api.github.com/repos/Fullscreen/fb-auth/tags","blobs_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fullscreen/fb-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/Fullscreen/fb-auth/languages","stargazers_url":"https://api.github.com/repos/Fullscreen/fb-auth/stargazers","contributors_url":"https://api.github.com/repos/Fullscreen/fb-auth/contributors","subscribers_url":"https://api.github.com/repos/Fullscreen/fb-auth/subscribers","subscription_url":"https://api.github.com/repos/Fullscreen/fb-auth/subscription","commits_url":"https://api.github.com/repos/Fullscreen/fb-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fullscreen/fb-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fullscreen/fb-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fullscreen/fb-auth/contents/{+path}","compare_url":"https://api.github.com/repos/Fullscreen/fb-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fullscreen/fb-auth/merges","archive_url":"https://api.github.com/repos/Fullscreen/fb-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fullscreen/fb-auth/downloads","issues_url":"https://api.github.com/repos/Fullscreen/fb-auth/issues{/number}","pulls_url":"https://api.github.com/repos/Fullscreen/fb-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/Fullscreen/fb-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/Fullscreen/fb-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fullscreen/fb-auth/labels{/name}","releases_url":"https://api.github.com/repos/Fullscreen/fb-auth/releases{/id}","deployments_url":"https://api.github.com/repos/Fullscreen/fb-auth/deployments","created_at":"2017-06-20T20:41:55Z","updated_at":"2017-06-22T21:43:54Z","pushed_at":"2017-07-06T20:54:50Z","git_url":"git://github.com/Fullscreen/fb-auth.git","ssh_url":"git@github.com:Fullscreen/fb-auth.git","clone_url":"https://github.com/Fullscreen/fb-auth.git","svn_url":"https://github.com/Fullscreen/fb-auth","homepage":null,"size":33,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13"},"html":{"href":"https://github.com/Fullscreen/fb-auth/pull/13"},"issue":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/issues/13"},"comments":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/Fullscreen/fb-auth/statuses/ee7caa56dab38c8d569bb058940de7a4818a2c22"}}}}
{"actor":{"display_login":"claudiofullscreen"}}