{"action":"created","comment":{"url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/comments/76157340","id":76157340,"diff_hunk":"@@ -1,4 +1,44 @@\n require 'rails_helper'\n \n describe Teammate do\n+  describe \".ratings_count scopes count to current event\" do\n+    let(:green_event) { create(:event, name: \"Green or Greener Event\") }\n+    let(:apple_event) { create(:event, name: \"Most Apple Event\") }\n+\n+    let(:dark_green_proposal) { create(:proposal, event: green_event) }\n+    let(:light_green_proposal) { create(:proposal, event: green_event) }\n+    let(:jack_proposal) { create(:proposal, event: apple_event) }\n+    let(:withdrawn_proposal) { create(:proposal, event: green_event, state: \"withdrawn\") }\n+\n+    let(:guy_user) { create(:user) }\n+    let(:gal_user) { create(:user) }\n+\n+    let(:green_guy_reviewer) { create(:teammate, event: green_event, user: guy_user, role: \"reviewer\") }\n+    let(:apple_guy_reviewer) { create(:teammate, event: apple_event, user: guy_user, role: \"reviewer\") }\n+    let(:green_gal_reviewer) { create(:teammate, event: green_event, user: gal_user, role: \"reviewer\") }\n+\n+    let!(:rating_1) { create(:rating, proposal: dark_green_proposal, user: guy_user) }\n+    let!(:rating_2) { create(:rating, proposal: light_green_proposal, user: guy_user) }\n+    let!(:rating_3) { create(:rating, proposal: jack_proposal, user: guy_user) }\n+    let!(:rating_4) { create(:rating, proposal: light_green_proposal, user: gal_user) }\n+    let!(:rating_5) { create(:rating, proposal: withdrawn_proposal, user: gal_user) }\n+\n+    it \"returns correct count for green event\" do","path":"spec/models/teammate_spec.rb","position":26,"original_position":26,"commit_id":"244a3d3ba554cff9b381af1639f39bf71a706be2","original_commit_id":"244a3d3ba554cff9b381af1639f39bf71a706be2","user":{"login":"gitcow","id":1417081,"avatar_url":"https://avatars.githubusercontent.com/u/1417081?v=3","gravatar_id":"","url":"https://api.github.com/users/gitcow","html_url":"https://github.com/gitcow","followers_url":"https://api.github.com/users/gitcow/followers","following_url":"https://api.github.com/users/gitcow/following{/other_user}","gists_url":"https://api.github.com/users/gitcow/gists{/gist_id}","starred_url":"https://api.github.com/users/gitcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitcow/subscriptions","organizations_url":"https://api.github.com/users/gitcow/orgs","repos_url":"https://api.github.com/users/gitcow/repos","events_url":"https://api.github.com/users/gitcow/events{/privacy}","received_events_url":"https://api.github.com/users/gitcow/received_events","type":"User","site_admin":false},"body":"I think the language here should be more generic. The describe above could be simply the name of the method, and here you can say it \"returns the teammate's rated proposal count for the given event\". Maybe create the ratings inside the actual it-block itself so that you can demonstrate the functionality with different combinations of ratings and events as you go.","created_at":"2016-08-24T23:20:03Z","updated_at":"2016-08-24T23:20:03Z","html_url":"https://github.com/HaughtCodeworks/cfp-app/pull/86#discussion_r76157340","pull_request_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/comments/76157340"},"html":{"href":"https://github.com/HaughtCodeworks/cfp-app/pull/86#discussion_r76157340"},"pull_request":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86","id":81720118,"html_url":"https://github.com/HaughtCodeworks/cfp-app/pull/86","diff_url":"https://github.com/HaughtCodeworks/cfp-app/pull/86.diff","patch_url":"https://github.com/HaughtCodeworks/cfp-app/pull/86.patch","issue_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/86","number":86,"state":"open","locked":false,"title":"#148 Adds ratings count to staff team page","user":{"login":"PenneyGadget","id":10964923,"avatar_url":"https://avatars.githubusercontent.com/u/10964923?v=3","gravatar_id":"","url":"https://api.github.com/users/PenneyGadget","html_url":"https://github.com/PenneyGadget","followers_url":"https://api.github.com/users/PenneyGadget/followers","following_url":"https://api.github.com/users/PenneyGadget/following{/other_user}","gists_url":"https://api.github.com/users/PenneyGadget/gists{/gist_id}","starred_url":"https://api.github.com/users/PenneyGadget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PenneyGadget/subscriptions","organizations_url":"https://api.github.com/users/PenneyGadget/orgs","repos_url":"https://api.github.com/users/PenneyGadget/repos","events_url":"https://api.github.com/users/PenneyGadget/events{/privacy}","received_events_url":"https://api.github.com/users/PenneyGadget/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-17T21:28:52Z","updated_at":"2016-08-24T23:20:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c4fc0e511cf1fc865a1c48b6451d7bd4e3ba3ef","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86/commits","review_comments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86/comments","review_comment_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/86/comments","statuses_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/statuses/244a3d3ba554cff9b381af1639f39bf71a706be2","head":{"label":"HaughtCodeworks:148-add-reviewer-stats","ref":"148-add-reviewer-stats","sha":"244a3d3ba554cff9b381af1639f39bf71a706be2","user":{"login":"HaughtCodeworks","id":17281718,"avatar_url":"https://avatars.githubusercontent.com/u/17281718?v=3","gravatar_id":"","url":"https://api.github.com/users/HaughtCodeworks","html_url":"https://github.com/HaughtCodeworks","followers_url":"https://api.github.com/users/HaughtCodeworks/followers","following_url":"https://api.github.com/users/HaughtCodeworks/following{/other_user}","gists_url":"https://api.github.com/users/HaughtCodeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/HaughtCodeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaughtCodeworks/subscriptions","organizations_url":"https://api.github.com/users/HaughtCodeworks/orgs","repos_url":"https://api.github.com/users/HaughtCodeworks/repos","events_url":"https://api.github.com/users/HaughtCodeworks/events{/privacy}","received_events_url":"https://api.github.com/users/HaughtCodeworks/received_events","type":"Organization","site_admin":false},"repo":{"id":60808659,"name":"cfp-app","full_name":"HaughtCodeworks/cfp-app","owner":{"login":"HaughtCodeworks","id":17281718,"avatar_url":"https://avatars.githubusercontent.com/u/17281718?v=3","gravatar_id":"","url":"https://api.github.com/users/HaughtCodeworks","html_url":"https://github.com/HaughtCodeworks","followers_url":"https://api.github.com/users/HaughtCodeworks/followers","following_url":"https://api.github.com/users/HaughtCodeworks/following{/other_user}","gists_url":"https://api.github.com/users/HaughtCodeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/HaughtCodeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaughtCodeworks/subscriptions","organizations_url":"https://api.github.com/users/HaughtCodeworks/orgs","repos_url":"https://api.github.com/users/HaughtCodeworks/repos","events_url":"https://api.github.com/users/HaughtCodeworks/events{/privacy}","received_events_url":"https://api.github.com/users/HaughtCodeworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaughtCodeworks/cfp-app","description":"Rails app for managing a conference CFP","fork":true,"url":"https://api.github.com/repos/HaughtCodeworks/cfp-app","forks_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/forks","keys_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/teams","hooks_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/hooks","issue_events_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/events{/number}","events_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/events","assignees_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/assignees{/user}","branches_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/branches{/branch}","tags_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/tags","blobs_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/statuses/{sha}","languages_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/languages","stargazers_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/stargazers","contributors_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/contributors","subscribers_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/subscribers","subscription_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/subscription","commits_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/contents/{+path}","compare_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/merges","archive_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/downloads","issues_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues{/number}","pulls_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls{/number}","milestones_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/milestones{/number}","notifications_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/labels{/name}","releases_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/releases{/id}","deployments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/deployments","created_at":"2016-06-09T21:35:28Z","updated_at":"2016-06-13T20:18:18Z","pushed_at":"2016-08-24T21:59:22Z","git_url":"git://github.com/HaughtCodeworks/cfp-app.git","ssh_url":"git@github.com:HaughtCodeworks/cfp-app.git","clone_url":"https://github.com/HaughtCodeworks/cfp-app.git","svn_url":"https://github.com/HaughtCodeworks/cfp-app","homepage":"","size":1304,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":1,"default_branch":"master"}},"base":{"label":"HaughtCodeworks:master","ref":"master","sha":"1a71e01f60ee1b16a9a2c7551565d4bed0c1957b","user":{"login":"HaughtCodeworks","id":17281718,"avatar_url":"https://avatars.githubusercontent.com/u/17281718?v=3","gravatar_id":"","url":"https://api.github.com/users/HaughtCodeworks","html_url":"https://github.com/HaughtCodeworks","followers_url":"https://api.github.com/users/HaughtCodeworks/followers","following_url":"https://api.github.com/users/HaughtCodeworks/following{/other_user}","gists_url":"https://api.github.com/users/HaughtCodeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/HaughtCodeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaughtCodeworks/subscriptions","organizations_url":"https://api.github.com/users/HaughtCodeworks/orgs","repos_url":"https://api.github.com/users/HaughtCodeworks/repos","events_url":"https://api.github.com/users/HaughtCodeworks/events{/privacy}","received_events_url":"https://api.github.com/users/HaughtCodeworks/received_events","type":"Organization","site_admin":false},"repo":{"id":60808659,"name":"cfp-app","full_name":"HaughtCodeworks/cfp-app","owner":{"login":"HaughtCodeworks","id":17281718,"avatar_url":"https://avatars.githubusercontent.com/u/17281718?v=3","gravatar_id":"","url":"https://api.github.com/users/HaughtCodeworks","html_url":"https://github.com/HaughtCodeworks","followers_url":"https://api.github.com/users/HaughtCodeworks/followers","following_url":"https://api.github.com/users/HaughtCodeworks/following{/other_user}","gists_url":"https://api.github.com/users/HaughtCodeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/HaughtCodeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaughtCodeworks/subscriptions","organizations_url":"https://api.github.com/users/HaughtCodeworks/orgs","repos_url":"https://api.github.com/users/HaughtCodeworks/repos","events_url":"https://api.github.com/users/HaughtCodeworks/events{/privacy}","received_events_url":"https://api.github.com/users/HaughtCodeworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaughtCodeworks/cfp-app","description":"Rails app for managing a conference CFP","fork":true,"url":"https://api.github.com/repos/HaughtCodeworks/cfp-app","forks_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/forks","keys_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/teams","hooks_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/hooks","issue_events_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/events{/number}","events_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/events","assignees_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/assignees{/user}","branches_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/branches{/branch}","tags_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/tags","blobs_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/statuses/{sha}","languages_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/languages","stargazers_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/stargazers","contributors_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/contributors","subscribers_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/subscribers","subscription_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/subscription","commits_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/contents/{+path}","compare_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/merges","archive_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/downloads","issues_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues{/number}","pulls_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls{/number}","milestones_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/milestones{/number}","notifications_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/labels{/name}","releases_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/releases{/id}","deployments_url":"https://api.github.com/repos/HaughtCodeworks/cfp-app/deployments","created_at":"2016-06-09T21:35:28Z","updated_at":"2016-06-13T20:18:18Z","pushed_at":"2016-08-24T21:59:22Z","git_url":"git://github.com/HaughtCodeworks/cfp-app.git","ssh_url":"git@github.com:HaughtCodeworks/cfp-app.git","clone_url":"https://github.com/HaughtCodeworks/cfp-app.git","svn_url":"https://github.com/HaughtCodeworks/cfp-app","homepage":"","size":1304,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86"},"html":{"href":"https://github.com/HaughtCodeworks/cfp-app/pull/86"},"issue":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/86"},"comments":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/HaughtCodeworks/cfp-app/statuses/244a3d3ba554cff9b381af1639f39bf71a706be2"}}}}
{"actor":{"display_login":"gitcow"}}