{"action":"created","comment":{"url":"https://api.github.com/repos/balamut80/qna/pulls/comments/29110848","id":29110848,"diff_hunk":"@@ -0,0 +1,60 @@\n+require 'rails_helper'\n+\n+RSpec.describe Vote, type: :model do\n+\n+  let!(:user) { create(:user) }\n+  let!(:other_user) { create :user }\n+  let!(:question) { create(:question, user: user) }\n+  let!(:answer) { create :answer, question: question }\n+\n+  it { should belong_to :votable }\n+  it { should belong_to :user }\n+  it { should validate_presence_of :user_id }\n+  it { should validate_inclusion_of(:value).in_array([-1, 1]) }\n+\n+\n+  describe 'User votes question' do\n+\n+    it 'like' do","path":"spec/models/vote_spec.rb","position":18,"original_position":18,"commit_id":"ef0bf094dc63084f1e1bb59ee64f34a29af912ff","original_commit_id":"ef0bf094dc63084f1e1bb59ee64f34a29af912ff","user":{"login":"vkurennov","id":968537,"avatar_url":"https://avatars.githubusercontent.com/u/968537?v=3","gravatar_id":"","url":"https://api.github.com/users/vkurennov","html_url":"https://github.com/vkurennov","followers_url":"https://api.github.com/users/vkurennov/followers","following_url":"https://api.github.com/users/vkurennov/following{/other_user}","gists_url":"https://api.github.com/users/vkurennov/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurennov/subscriptions","organizations_url":"https://api.github.com/users/vkurennov/orgs","repos_url":"https://api.github.com/users/vkurennov/repos","events_url":"https://api.github.com/users/vkurennov/events{/privacy}","received_events_url":"https://api.github.com/users/vkurennov/received_events","type":"User","site_admin":false},"body":"В unit-тестах действует правило: один тест - один expect. А тесты следует объединять по методам через describe. При этом тесты для `voted_by?` следует вынести в отдельный describe.","created_at":"2015-04-26T15:27:59Z","updated_at":"2015-04-26T15:27:59Z","html_url":"https://github.com/balamut80/qna/pull/7#discussion_r29110848","pull_request_url":"https://api.github.com/repos/balamut80/qna/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/balamut80/qna/pulls/comments/29110848"},"html":{"href":"https://github.com/balamut80/qna/pull/7#discussion_r29110848"},"pull_request":{"href":"https://api.github.com/repos/balamut80/qna/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/balamut80/qna/pulls/7","id":34120025,"html_url":"https://github.com/balamut80/qna/pull/7","diff_url":"https://github.com/balamut80/qna/pull/7.diff","patch_url":"https://github.com/balamut80/qna/pull/7.patch","issue_url":"https://api.github.com/repos/balamut80/qna/issues/7","number":7,"state":"open","locked":false,"title":"vote for answers and questions","user":{"login":"balamut80","id":11394918,"avatar_url":"https://avatars.githubusercontent.com/u/11394918?v=3","gravatar_id":"","url":"https://api.github.com/users/balamut80","html_url":"https://github.com/balamut80","followers_url":"https://api.github.com/users/balamut80/followers","following_url":"https://api.github.com/users/balamut80/following{/other_user}","gists_url":"https://api.github.com/users/balamut80/gists{/gist_id}","starred_url":"https://api.github.com/users/balamut80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balamut80/subscriptions","organizations_url":"https://api.github.com/users/balamut80/orgs","repos_url":"https://api.github.com/users/balamut80/repos","events_url":"https://api.github.com/users/balamut80/events{/privacy}","received_events_url":"https://api.github.com/users/balamut80/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-26T08:51:26Z","updated_at":"2015-04-26T15:27:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ac515841351efb8e08e022007f1bab04f238c7d","assignee":{"login":"vkurennov","id":968537,"avatar_url":"https://avatars.githubusercontent.com/u/968537?v=3","gravatar_id":"","url":"https://api.github.com/users/vkurennov","html_url":"https://github.com/vkurennov","followers_url":"https://api.github.com/users/vkurennov/followers","following_url":"https://api.github.com/users/vkurennov/following{/other_user}","gists_url":"https://api.github.com/users/vkurennov/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurennov/subscriptions","organizations_url":"https://api.github.com/users/vkurennov/orgs","repos_url":"https://api.github.com/users/vkurennov/repos","events_url":"https://api.github.com/users/vkurennov/events{/privacy}","received_events_url":"https://api.github.com/users/vkurennov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/balamut80/qna/pulls/7/commits","review_comments_url":"https://api.github.com/repos/balamut80/qna/pulls/7/comments","review_comment_url":"https://api.github.com/repos/balamut80/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balamut80/qna/issues/7/comments","statuses_url":"https://api.github.com/repos/balamut80/qna/statuses/ef0bf094dc63084f1e1bb59ee64f34a29af912ff","head":{"label":"balamut80:lesson_9","ref":"lesson_9","sha":"ef0bf094dc63084f1e1bb59ee64f34a29af912ff","user":{"login":"balamut80","id":11394918,"avatar_url":"https://avatars.githubusercontent.com/u/11394918?v=3","gravatar_id":"","url":"https://api.github.com/users/balamut80","html_url":"https://github.com/balamut80","followers_url":"https://api.github.com/users/balamut80/followers","following_url":"https://api.github.com/users/balamut80/following{/other_user}","gists_url":"https://api.github.com/users/balamut80/gists{/gist_id}","starred_url":"https://api.github.com/users/balamut80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balamut80/subscriptions","organizations_url":"https://api.github.com/users/balamut80/orgs","repos_url":"https://api.github.com/users/balamut80/repos","events_url":"https://api.github.com/users/balamut80/events{/privacy}","received_events_url":"https://api.github.com/users/balamut80/received_events","type":"User","site_admin":false},"repo":{"id":31980929,"name":"qna","full_name":"balamut80/qna","owner":{"login":"balamut80","id":11394918,"avatar_url":"https://avatars.githubusercontent.com/u/11394918?v=3","gravatar_id":"","url":"https://api.github.com/users/balamut80","html_url":"https://github.com/balamut80","followers_url":"https://api.github.com/users/balamut80/followers","following_url":"https://api.github.com/users/balamut80/following{/other_user}","gists_url":"https://api.github.com/users/balamut80/gists{/gist_id}","starred_url":"https://api.github.com/users/balamut80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balamut80/subscriptions","organizations_url":"https://api.github.com/users/balamut80/orgs","repos_url":"https://api.github.com/users/balamut80/repos","events_url":"https://api.github.com/users/balamut80/events{/privacy}","received_events_url":"https://api.github.com/users/balamut80/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balamut80/qna","description":"thinknetica course project","fork":false,"url":"https://api.github.com/repos/balamut80/qna","forks_url":"https://api.github.com/repos/balamut80/qna/forks","keys_url":"https://api.github.com/repos/balamut80/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balamut80/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balamut80/qna/teams","hooks_url":"https://api.github.com/repos/balamut80/qna/hooks","issue_events_url":"https://api.github.com/repos/balamut80/qna/issues/events{/number}","events_url":"https://api.github.com/repos/balamut80/qna/events","assignees_url":"https://api.github.com/repos/balamut80/qna/assignees{/user}","branches_url":"https://api.github.com/repos/balamut80/qna/branches{/branch}","tags_url":"https://api.github.com/repos/balamut80/qna/tags","blobs_url":"https://api.github.com/repos/balamut80/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balamut80/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balamut80/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/balamut80/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balamut80/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/balamut80/qna/languages","stargazers_url":"https://api.github.com/repos/balamut80/qna/stargazers","contributors_url":"https://api.github.com/repos/balamut80/qna/contributors","subscribers_url":"https://api.github.com/repos/balamut80/qna/subscribers","subscription_url":"https://api.github.com/repos/balamut80/qna/subscription","commits_url":"https://api.github.com/repos/balamut80/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/balamut80/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/balamut80/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/balamut80/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/balamut80/qna/contents/{+path}","compare_url":"https://api.github.com/repos/balamut80/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balamut80/qna/merges","archive_url":"https://api.github.com/repos/balamut80/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balamut80/qna/downloads","issues_url":"https://api.github.com/repos/balamut80/qna/issues{/number}","pulls_url":"https://api.github.com/repos/balamut80/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/balamut80/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/balamut80/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balamut80/qna/labels{/name}","releases_url":"https://api.github.com/repos/balamut80/qna/releases{/id}","created_at":"2015-03-10T20:46:01Z","updated_at":"2015-04-12T18:54:23Z","pushed_at":"2015-04-26T08:51:26Z","git_url":"git://github.com/balamut80/qna.git","ssh_url":"git@github.com:balamut80/qna.git","clone_url":"https://github.com/balamut80/qna.git","svn_url":"https://github.com/balamut80/qna","homepage":null,"size":440,"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":"balamut80:master","ref":"master","sha":"1989f2ed76a47f066e14caf69779f6d6f002913a","user":{"login":"balamut80","id":11394918,"avatar_url":"https://avatars.githubusercontent.com/u/11394918?v=3","gravatar_id":"","url":"https://api.github.com/users/balamut80","html_url":"https://github.com/balamut80","followers_url":"https://api.github.com/users/balamut80/followers","following_url":"https://api.github.com/users/balamut80/following{/other_user}","gists_url":"https://api.github.com/users/balamut80/gists{/gist_id}","starred_url":"https://api.github.com/users/balamut80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balamut80/subscriptions","organizations_url":"https://api.github.com/users/balamut80/orgs","repos_url":"https://api.github.com/users/balamut80/repos","events_url":"https://api.github.com/users/balamut80/events{/privacy}","received_events_url":"https://api.github.com/users/balamut80/received_events","type":"User","site_admin":false},"repo":{"id":31980929,"name":"qna","full_name":"balamut80/qna","owner":{"login":"balamut80","id":11394918,"avatar_url":"https://avatars.githubusercontent.com/u/11394918?v=3","gravatar_id":"","url":"https://api.github.com/users/balamut80","html_url":"https://github.com/balamut80","followers_url":"https://api.github.com/users/balamut80/followers","following_url":"https://api.github.com/users/balamut80/following{/other_user}","gists_url":"https://api.github.com/users/balamut80/gists{/gist_id}","starred_url":"https://api.github.com/users/balamut80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balamut80/subscriptions","organizations_url":"https://api.github.com/users/balamut80/orgs","repos_url":"https://api.github.com/users/balamut80/repos","events_url":"https://api.github.com/users/balamut80/events{/privacy}","received_events_url":"https://api.github.com/users/balamut80/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balamut80/qna","description":"thinknetica course project","fork":false,"url":"https://api.github.com/repos/balamut80/qna","forks_url":"https://api.github.com/repos/balamut80/qna/forks","keys_url":"https://api.github.com/repos/balamut80/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balamut80/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balamut80/qna/teams","hooks_url":"https://api.github.com/repos/balamut80/qna/hooks","issue_events_url":"https://api.github.com/repos/balamut80/qna/issues/events{/number}","events_url":"https://api.github.com/repos/balamut80/qna/events","assignees_url":"https://api.github.com/repos/balamut80/qna/assignees{/user}","branches_url":"https://api.github.com/repos/balamut80/qna/branches{/branch}","tags_url":"https://api.github.com/repos/balamut80/qna/tags","blobs_url":"https://api.github.com/repos/balamut80/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balamut80/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balamut80/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/balamut80/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balamut80/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/balamut80/qna/languages","stargazers_url":"https://api.github.com/repos/balamut80/qna/stargazers","contributors_url":"https://api.github.com/repos/balamut80/qna/contributors","subscribers_url":"https://api.github.com/repos/balamut80/qna/subscribers","subscription_url":"https://api.github.com/repos/balamut80/qna/subscription","commits_url":"https://api.github.com/repos/balamut80/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/balamut80/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/balamut80/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/balamut80/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/balamut80/qna/contents/{+path}","compare_url":"https://api.github.com/repos/balamut80/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balamut80/qna/merges","archive_url":"https://api.github.com/repos/balamut80/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balamut80/qna/downloads","issues_url":"https://api.github.com/repos/balamut80/qna/issues{/number}","pulls_url":"https://api.github.com/repos/balamut80/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/balamut80/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/balamut80/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balamut80/qna/labels{/name}","releases_url":"https://api.github.com/repos/balamut80/qna/releases{/id}","created_at":"2015-03-10T20:46:01Z","updated_at":"2015-04-12T18:54:23Z","pushed_at":"2015-04-26T08:51:26Z","git_url":"git://github.com/balamut80/qna.git","ssh_url":"git@github.com:balamut80/qna.git","clone_url":"https://github.com/balamut80/qna.git","svn_url":"https://github.com/balamut80/qna","homepage":null,"size":440,"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/balamut80/qna/pulls/7"},"html":{"href":"https://github.com/balamut80/qna/pull/7"},"issue":{"href":"https://api.github.com/repos/balamut80/qna/issues/7"},"comments":{"href":"https://api.github.com/repos/balamut80/qna/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/balamut80/qna/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/balamut80/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balamut80/qna/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/balamut80/qna/statuses/ef0bf094dc63084f1e1bb59ee64f34a29af912ff"}}}}