{"action":"created","comment":{"url":"https://api.github.com/repos/norahito/dive23/pulls/comments/78294896","id":78294896,"diff_hunk":"@@ -0,0 +1,6 @@\n+require 'rails_helper'\n+\n+RSpec.describe VotesController, type: :controller do","path":"spec/controllers/votes_controller_spec.rb","position":3,"original_position":3,"commit_id":"c905fca89d73a704a3628a0c6a1e89fee8805da8","original_commit_id":"c905fca89d73a704a3628a0c6a1e89fee8805da8","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"body":"このテストメソッドのスケルトンは要らないと思います。","created_at":"2016-09-11T13:09:34Z","updated_at":"2016-09-11T13:09:34Z","html_url":"https://github.com/norahito/dive23/pull/120#discussion_r78294896","pull_request_url":"https://api.github.com/repos/norahito/dive23/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/norahito/dive23/pulls/comments/78294896"},"html":{"href":"https://github.com/norahito/dive23/pull/120#discussion_r78294896"},"pull_request":{"href":"https://api.github.com/repos/norahito/dive23/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/norahito/dive23/pulls/120","id":84777903,"html_url":"https://github.com/norahito/dive23/pull/120","diff_url":"https://github.com/norahito/dive23/pull/120.diff","patch_url":"https://github.com/norahito/dive23/pull/120.patch","issue_url":"https://api.github.com/repos/norahito/dive23/issues/120","number":120,"state":"open","locked":false,"title":"【Fixed】投票(votes)のルーティング設定とコントローラ作成","user":{"login":"choochoopiston","id":19501004,"avatar_url":"https://avatars.githubusercontent.com/u/19501004?v=3","gravatar_id":"","url":"https://api.github.com/users/choochoopiston","html_url":"https://github.com/choochoopiston","followers_url":"https://api.github.com/users/choochoopiston/followers","following_url":"https://api.github.com/users/choochoopiston/following{/other_user}","gists_url":"https://api.github.com/users/choochoopiston/gists{/gist_id}","starred_url":"https://api.github.com/users/choochoopiston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choochoopiston/subscriptions","organizations_url":"https://api.github.com/users/choochoopiston/orgs","repos_url":"https://api.github.com/users/choochoopiston/repos","events_url":"https://api.github.com/users/choochoopiston/events{/privacy}","received_events_url":"https://api.github.com/users/choochoopiston/received_events","type":"User","site_admin":false},"body":"#116 \r\n\r\n①ルーティング設定\r\nresources :votes, only: [:create, :destroy]をquestionsのルーティング配下と、answersのルーティング配下の両方に設置\r\n\r\n②votes_controller、createメソッドとdestroyメソッドを設定\r\nだいぶ肥大化してしまいました。。。すっきりできる方法があればご教授いただければ幸いです。\r\n簡単に私がやろうとしたことは、以下になります。\r\n[createメソッド]\r\n1) 投票のリクエスト送信のURLのパスの違いによって、質問に対する投票か、回答に対する投票かを分岐\r\n2) 投票する際にvoteパラメータ（posiかnega)を付与する\r\n3) そのvoteパラメータにより、posi投票もしくはnega投票として保存、加えて、質問や回答のposi_countsもしくなnega_countsを+1。\r\ndestroyメソッドも、分岐等は上記と同じになります。\r\n\r\n","created_at":"2016-09-11T05:54:48Z","updated_at":"2016-09-11T13:09:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"097da7041ac8e6de1b6220072a4872d727a58321","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/norahito/dive23/pulls/120/commits","review_comments_url":"https://api.github.com/repos/norahito/dive23/pulls/120/comments","review_comment_url":"https://api.github.com/repos/norahito/dive23/pulls/comments{/number}","comments_url":"https://api.github.com/repos/norahito/dive23/issues/120/comments","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/c905fca89d73a704a3628a0c6a1e89fee8805da8","head":{"label":"norahito:issues#116","ref":"issues#116","sha":"c905fca89d73a704a3628a0c6a1e89fee8805da8","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"repo":{"id":65704670,"name":"dive23","full_name":"norahito/dive23","owner":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/norahito/dive23","description":"repository for dive23","fork":false,"url":"https://api.github.com/repos/norahito/dive23","forks_url":"https://api.github.com/repos/norahito/dive23/forks","keys_url":"https://api.github.com/repos/norahito/dive23/keys{/key_id}","collaborators_url":"https://api.github.com/repos/norahito/dive23/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/norahito/dive23/teams","hooks_url":"https://api.github.com/repos/norahito/dive23/hooks","issue_events_url":"https://api.github.com/repos/norahito/dive23/issues/events{/number}","events_url":"https://api.github.com/repos/norahito/dive23/events","assignees_url":"https://api.github.com/repos/norahito/dive23/assignees{/user}","branches_url":"https://api.github.com/repos/norahito/dive23/branches{/branch}","tags_url":"https://api.github.com/repos/norahito/dive23/tags","blobs_url":"https://api.github.com/repos/norahito/dive23/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/norahito/dive23/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/norahito/dive23/git/refs{/sha}","trees_url":"https://api.github.com/repos/norahito/dive23/git/trees{/sha}","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/{sha}","languages_url":"https://api.github.com/repos/norahito/dive23/languages","stargazers_url":"https://api.github.com/repos/norahito/dive23/stargazers","contributors_url":"https://api.github.com/repos/norahito/dive23/contributors","subscribers_url":"https://api.github.com/repos/norahito/dive23/subscribers","subscription_url":"https://api.github.com/repos/norahito/dive23/subscription","commits_url":"https://api.github.com/repos/norahito/dive23/commits{/sha}","git_commits_url":"https://api.github.com/repos/norahito/dive23/git/commits{/sha}","comments_url":"https://api.github.com/repos/norahito/dive23/comments{/number}","issue_comment_url":"https://api.github.com/repos/norahito/dive23/issues/comments{/number}","contents_url":"https://api.github.com/repos/norahito/dive23/contents/{+path}","compare_url":"https://api.github.com/repos/norahito/dive23/compare/{base}...{head}","merges_url":"https://api.github.com/repos/norahito/dive23/merges","archive_url":"https://api.github.com/repos/norahito/dive23/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/norahito/dive23/downloads","issues_url":"https://api.github.com/repos/norahito/dive23/issues{/number}","pulls_url":"https://api.github.com/repos/norahito/dive23/pulls{/number}","milestones_url":"https://api.github.com/repos/norahito/dive23/milestones{/number}","notifications_url":"https://api.github.com/repos/norahito/dive23/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/norahito/dive23/labels{/name}","releases_url":"https://api.github.com/repos/norahito/dive23/releases{/id}","deployments_url":"https://api.github.com/repos/norahito/dive23/deployments","created_at":"2016-08-15T04:32:55Z","updated_at":"2016-08-15T12:15:08Z","pushed_at":"2016-09-11T05:54:49Z","git_url":"git://github.com/norahito/dive23.git","ssh_url":"git@github.com:norahito/dive23.git","clone_url":"https://github.com/norahito/dive23.git","svn_url":"https://github.com/norahito/dive23","homepage":null,"size":152,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":1,"default_branch":"master"}},"base":{"label":"norahito:master","ref":"master","sha":"117f25799cb26f86c30b5017d0641ef208e5fb96","user":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"repo":{"id":65704670,"name":"dive23","full_name":"norahito/dive23","owner":{"login":"norahito","id":20297591,"avatar_url":"https://avatars.githubusercontent.com/u/20297591?v=3","gravatar_id":"","url":"https://api.github.com/users/norahito","html_url":"https://github.com/norahito","followers_url":"https://api.github.com/users/norahito/followers","following_url":"https://api.github.com/users/norahito/following{/other_user}","gists_url":"https://api.github.com/users/norahito/gists{/gist_id}","starred_url":"https://api.github.com/users/norahito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norahito/subscriptions","organizations_url":"https://api.github.com/users/norahito/orgs","repos_url":"https://api.github.com/users/norahito/repos","events_url":"https://api.github.com/users/norahito/events{/privacy}","received_events_url":"https://api.github.com/users/norahito/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/norahito/dive23","description":"repository for dive23","fork":false,"url":"https://api.github.com/repos/norahito/dive23","forks_url":"https://api.github.com/repos/norahito/dive23/forks","keys_url":"https://api.github.com/repos/norahito/dive23/keys{/key_id}","collaborators_url":"https://api.github.com/repos/norahito/dive23/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/norahito/dive23/teams","hooks_url":"https://api.github.com/repos/norahito/dive23/hooks","issue_events_url":"https://api.github.com/repos/norahito/dive23/issues/events{/number}","events_url":"https://api.github.com/repos/norahito/dive23/events","assignees_url":"https://api.github.com/repos/norahito/dive23/assignees{/user}","branches_url":"https://api.github.com/repos/norahito/dive23/branches{/branch}","tags_url":"https://api.github.com/repos/norahito/dive23/tags","blobs_url":"https://api.github.com/repos/norahito/dive23/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/norahito/dive23/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/norahito/dive23/git/refs{/sha}","trees_url":"https://api.github.com/repos/norahito/dive23/git/trees{/sha}","statuses_url":"https://api.github.com/repos/norahito/dive23/statuses/{sha}","languages_url":"https://api.github.com/repos/norahito/dive23/languages","stargazers_url":"https://api.github.com/repos/norahito/dive23/stargazers","contributors_url":"https://api.github.com/repos/norahito/dive23/contributors","subscribers_url":"https://api.github.com/repos/norahito/dive23/subscribers","subscription_url":"https://api.github.com/repos/norahito/dive23/subscription","commits_url":"https://api.github.com/repos/norahito/dive23/commits{/sha}","git_commits_url":"https://api.github.com/repos/norahito/dive23/git/commits{/sha}","comments_url":"https://api.github.com/repos/norahito/dive23/comments{/number}","issue_comment_url":"https://api.github.com/repos/norahito/dive23/issues/comments{/number}","contents_url":"https://api.github.com/repos/norahito/dive23/contents/{+path}","compare_url":"https://api.github.com/repos/norahito/dive23/compare/{base}...{head}","merges_url":"https://api.github.com/repos/norahito/dive23/merges","archive_url":"https://api.github.com/repos/norahito/dive23/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/norahito/dive23/downloads","issues_url":"https://api.github.com/repos/norahito/dive23/issues{/number}","pulls_url":"https://api.github.com/repos/norahito/dive23/pulls{/number}","milestones_url":"https://api.github.com/repos/norahito/dive23/milestones{/number}","notifications_url":"https://api.github.com/repos/norahito/dive23/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/norahito/dive23/labels{/name}","releases_url":"https://api.github.com/repos/norahito/dive23/releases{/id}","deployments_url":"https://api.github.com/repos/norahito/dive23/deployments","created_at":"2016-08-15T04:32:55Z","updated_at":"2016-08-15T12:15:08Z","pushed_at":"2016-09-11T05:54:49Z","git_url":"git://github.com/norahito/dive23.git","ssh_url":"git@github.com:norahito/dive23.git","clone_url":"https://github.com/norahito/dive23.git","svn_url":"https://github.com/norahito/dive23","homepage":null,"size":152,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/norahito/dive23/pulls/120"},"html":{"href":"https://github.com/norahito/dive23/pull/120"},"issue":{"href":"https://api.github.com/repos/norahito/dive23/issues/120"},"comments":{"href":"https://api.github.com/repos/norahito/dive23/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/norahito/dive23/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/norahito/dive23/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/norahito/dive23/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/norahito/dive23/statuses/c905fca89d73a704a3628a0c6a1e89fee8805da8"}}}}
{"actor":{"display_login":"norahito"}}