{"action":"created","comment":{"url":"https://api.github.com/repos/DenisRebenok/qna/pulls/comments/79135901","id":79135901,"diff_hunk":"@@ -0,0 +1,93 @@\n+require_relative 'acceptance_helper'\n+\n+feature 'user can vote for answer', %q{\n+  In order to select best answer\n+  As a registered user\n+  I can to vote for answer\n+} do\n+\n+  given!(:user) { create(:user) }\n+  given!(:another_user) { create(:user) }\n+  given!(:question) { create(:question) }\n+  given!(:another_question) { create(:question) }\n+\n+  given!(:answer) { create(:answer, user: another_user, question: question) }\n+  given!(:user_answer) { create(:answer, user: user, question: another_question) }\n+\n+  describe 'authenticated user' do\n+    background do\n+      sign_in(user)\n+      visit question_path(question)\n+    end\n+\n+    scenario 'can vote up for question', js: true do\n+      within '.answer .vote-control' do\n+        expect(page).to have_css('.object-vote-result', text: '0')\n+\n+        click_on 'vote up'\n+\n+        expect(page).to have_css('.object-vote-result', text: '1')\n+        expect(current_path).to eq question_path(question)\n+      end\n+    end\n+\n+    scenario 'can vote down for question', js: true do\n+      within '.answer .vote-control' do\n+        expect(page).to have_css('.object-vote-result', text: '0')\n+\n+        click_on 'vote down'\n+\n+        expect(page).to have_css('.object-vote-result', text: '-1')\n+        expect(current_path).to eq question_path(question)\n+      end\n+    end\n+\n+    scenario 'cannot vote for own questions', js: true do","path":"spec/acceptance/vote_answer_spec.rb","position":45,"original_position":45,"commit_id":"a3492275330211784190acacfbd94d34f608add0","original_commit_id":"a3492275330211784190acacfbd94d34f608add0","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":"И тут answer","created_at":"2016-09-16T09:33:34Z","updated_at":"2016-09-16T09:33:34Z","html_url":"https://github.com/DenisRebenok/qna/pull/7#discussion_r79135901","pull_request_url":"https://api.github.com/repos/DenisRebenok/qna/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/DenisRebenok/qna/pulls/comments/79135901"},"html":{"href":"https://github.com/DenisRebenok/qna/pull/7#discussion_r79135901"},"pull_request":{"href":"https://api.github.com/repos/DenisRebenok/qna/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/DenisRebenok/qna/pulls/7","id":85449947,"html_url":"https://github.com/DenisRebenok/qna/pull/7","diff_url":"https://github.com/DenisRebenok/qna/pull/7.diff","patch_url":"https://github.com/DenisRebenok/qna/pull/7.patch","issue_url":"https://api.github.com/repos/DenisRebenok/qna/issues/7","number":7,"state":"open","locked":false,"title":"Lesson 9 (ajax в Rails + Rails Concerns)","user":{"login":"DenisRebenok","id":8539872,"avatar_url":"https://avatars.githubusercontent.com/u/8539872?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisRebenok","html_url":"https://github.com/DenisRebenok","followers_url":"https://api.github.com/users/DenisRebenok/followers","following_url":"https://api.github.com/users/DenisRebenok/following{/other_user}","gists_url":"https://api.github.com/users/DenisRebenok/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisRebenok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisRebenok/subscriptions","organizations_url":"https://api.github.com/users/DenisRebenok/orgs","repos_url":"https://api.github.com/users/DenisRebenok/repos","events_url":"https://api.github.com/users/DenisRebenok/events{/privacy}","received_events_url":"https://api.github.com/users/DenisRebenok/received_events","type":"User","site_admin":false},"body":"Реализованы сл. истории, используя JSON:\r\n - Аутентифицированный пользователь может голосовать за понравившийся вопрос/ответ\r\n - Пользователь не может голосовать за свой вопрос/ответ\r\n - Пользователь может проголосовать \"за\" или \"против\" конкретного вопроса/ответа только один раз (нельзя голосовать 2 раза подряд \"за\" или \"против\")\r\n - Пользователь может отменить свое решение и после этого переголосовать.\r\n - У вопроса/ответа должен выводиться результирующий рейтинг (разница между голосами \"за\" и \"против\")","created_at":"2016-09-15T17:54:31Z","updated_at":"2016-09-16T09:35:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc960f3bf5bd3f2f20c9a98319989e62999ae843","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DenisRebenok/qna/pulls/7/commits","review_comments_url":"https://api.github.com/repos/DenisRebenok/qna/pulls/7/comments","review_comment_url":"https://api.github.com/repos/DenisRebenok/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DenisRebenok/qna/issues/7/comments","statuses_url":"https://api.github.com/repos/DenisRebenok/qna/statuses/a3492275330211784190acacfbd94d34f608add0","head":{"label":"DenisRebenok:lesson-9","ref":"lesson-9","sha":"a3492275330211784190acacfbd94d34f608add0","user":{"login":"DenisRebenok","id":8539872,"avatar_url":"https://avatars.githubusercontent.com/u/8539872?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisRebenok","html_url":"https://github.com/DenisRebenok","followers_url":"https://api.github.com/users/DenisRebenok/followers","following_url":"https://api.github.com/users/DenisRebenok/following{/other_user}","gists_url":"https://api.github.com/users/DenisRebenok/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisRebenok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisRebenok/subscriptions","organizations_url":"https://api.github.com/users/DenisRebenok/orgs","repos_url":"https://api.github.com/users/DenisRebenok/repos","events_url":"https://api.github.com/users/DenisRebenok/events{/privacy}","received_events_url":"https://api.github.com/users/DenisRebenok/received_events","type":"User","site_admin":false},"repo":{"id":54277972,"name":"qna","full_name":"DenisRebenok/qna","owner":{"login":"DenisRebenok","id":8539872,"avatar_url":"https://avatars.githubusercontent.com/u/8539872?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisRebenok","html_url":"https://github.com/DenisRebenok","followers_url":"https://api.github.com/users/DenisRebenok/followers","following_url":"https://api.github.com/users/DenisRebenok/following{/other_user}","gists_url":"https://api.github.com/users/DenisRebenok/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisRebenok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisRebenok/subscriptions","organizations_url":"https://api.github.com/users/DenisRebenok/orgs","repos_url":"https://api.github.com/users/DenisRebenok/repos","events_url":"https://api.github.com/users/DenisRebenok/events{/privacy}","received_events_url":"https://api.github.com/users/DenisRebenok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DenisRebenok/qna","description":"Система вопросов и ответов. Аналог stackoverflow.com. Учебный проект в онлайн-школе thinknetica.com","fork":false,"url":"https://api.github.com/repos/DenisRebenok/qna","forks_url":"https://api.github.com/repos/DenisRebenok/qna/forks","keys_url":"https://api.github.com/repos/DenisRebenok/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DenisRebenok/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DenisRebenok/qna/teams","hooks_url":"https://api.github.com/repos/DenisRebenok/qna/hooks","issue_events_url":"https://api.github.com/repos/DenisRebenok/qna/issues/events{/number}","events_url":"https://api.github.com/repos/DenisRebenok/qna/events","assignees_url":"https://api.github.com/repos/DenisRebenok/qna/assignees{/user}","branches_url":"https://api.github.com/repos/DenisRebenok/qna/branches{/branch}","tags_url":"https://api.github.com/repos/DenisRebenok/qna/tags","blobs_url":"https://api.github.com/repos/DenisRebenok/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DenisRebenok/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DenisRebenok/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/DenisRebenok/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DenisRebenok/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/DenisRebenok/qna/languages","stargazers_url":"https://api.github.com/repos/DenisRebenok/qna/stargazers","contributors_url":"https://api.github.com/repos/DenisRebenok/qna/contributors","subscribers_url":"https://api.github.com/repos/DenisRebenok/qna/subscribers","subscription_url":"https://api.github.com/repos/DenisRebenok/qna/subscription","commits_url":"https://api.github.com/repos/DenisRebenok/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/DenisRebenok/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/DenisRebenok/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/DenisRebenok/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/DenisRebenok/qna/contents/{+path}","compare_url":"https://api.github.com/repos/DenisRebenok/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DenisRebenok/qna/merges","archive_url":"https://api.github.com/repos/DenisRebenok/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DenisRebenok/qna/downloads","issues_url":"https://api.github.com/repos/DenisRebenok/qna/issues{/number}","pulls_url":"https://api.github.com/repos/DenisRebenok/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/DenisRebenok/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/DenisRebenok/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DenisRebenok/qna/labels{/name}","releases_url":"https://api.github.com/repos/DenisRebenok/qna/releases{/id}","deployments_url":"https://api.github.com/repos/DenisRebenok/qna/deployments","created_at":"2016-03-19T17:19:31Z","updated_at":"2016-04-16T15:03:07Z","pushed_at":"2016-09-15T17:54:31Z","git_url":"git://github.com/DenisRebenok/qna.git","ssh_url":"git@github.com:DenisRebenok/qna.git","clone_url":"https://github.com/DenisRebenok/qna.git","svn_url":"https://github.com/DenisRebenok/qna","homepage":"","size":119,"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":"DenisRebenok:master","ref":"master","sha":"f8932d9fa71b7fa1cc0a0935314fa011d6942748","user":{"login":"DenisRebenok","id":8539872,"avatar_url":"https://avatars.githubusercontent.com/u/8539872?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisRebenok","html_url":"https://github.com/DenisRebenok","followers_url":"https://api.github.com/users/DenisRebenok/followers","following_url":"https://api.github.com/users/DenisRebenok/following{/other_user}","gists_url":"https://api.github.com/users/DenisRebenok/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisRebenok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisRebenok/subscriptions","organizations_url":"https://api.github.com/users/DenisRebenok/orgs","repos_url":"https://api.github.com/users/DenisRebenok/repos","events_url":"https://api.github.com/users/DenisRebenok/events{/privacy}","received_events_url":"https://api.github.com/users/DenisRebenok/received_events","type":"User","site_admin":false},"repo":{"id":54277972,"name":"qna","full_name":"DenisRebenok/qna","owner":{"login":"DenisRebenok","id":8539872,"avatar_url":"https://avatars.githubusercontent.com/u/8539872?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisRebenok","html_url":"https://github.com/DenisRebenok","followers_url":"https://api.github.com/users/DenisRebenok/followers","following_url":"https://api.github.com/users/DenisRebenok/following{/other_user}","gists_url":"https://api.github.com/users/DenisRebenok/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisRebenok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisRebenok/subscriptions","organizations_url":"https://api.github.com/users/DenisRebenok/orgs","repos_url":"https://api.github.com/users/DenisRebenok/repos","events_url":"https://api.github.com/users/DenisRebenok/events{/privacy}","received_events_url":"https://api.github.com/users/DenisRebenok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DenisRebenok/qna","description":"Система вопросов и ответов. Аналог stackoverflow.com. Учебный проект в онлайн-школе thinknetica.com","fork":false,"url":"https://api.github.com/repos/DenisRebenok/qna","forks_url":"https://api.github.com/repos/DenisRebenok/qna/forks","keys_url":"https://api.github.com/repos/DenisRebenok/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DenisRebenok/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DenisRebenok/qna/teams","hooks_url":"https://api.github.com/repos/DenisRebenok/qna/hooks","issue_events_url":"https://api.github.com/repos/DenisRebenok/qna/issues/events{/number}","events_url":"https://api.github.com/repos/DenisRebenok/qna/events","assignees_url":"https://api.github.com/repos/DenisRebenok/qna/assignees{/user}","branches_url":"https://api.github.com/repos/DenisRebenok/qna/branches{/branch}","tags_url":"https://api.github.com/repos/DenisRebenok/qna/tags","blobs_url":"https://api.github.com/repos/DenisRebenok/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DenisRebenok/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DenisRebenok/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/DenisRebenok/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DenisRebenok/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/DenisRebenok/qna/languages","stargazers_url":"https://api.github.com/repos/DenisRebenok/qna/stargazers","contributors_url":"https://api.github.com/repos/DenisRebenok/qna/contributors","subscribers_url":"https://api.github.com/repos/DenisRebenok/qna/subscribers","subscription_url":"https://api.github.com/repos/DenisRebenok/qna/subscription","commits_url":"https://api.github.com/repos/DenisRebenok/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/DenisRebenok/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/DenisRebenok/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/DenisRebenok/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/DenisRebenok/qna/contents/{+path}","compare_url":"https://api.github.com/repos/DenisRebenok/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DenisRebenok/qna/merges","archive_url":"https://api.github.com/repos/DenisRebenok/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DenisRebenok/qna/downloads","issues_url":"https://api.github.com/repos/DenisRebenok/qna/issues{/number}","pulls_url":"https://api.github.com/repos/DenisRebenok/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/DenisRebenok/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/DenisRebenok/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DenisRebenok/qna/labels{/name}","releases_url":"https://api.github.com/repos/DenisRebenok/qna/releases{/id}","deployments_url":"https://api.github.com/repos/DenisRebenok/qna/deployments","created_at":"2016-03-19T17:19:31Z","updated_at":"2016-04-16T15:03:07Z","pushed_at":"2016-09-15T17:54:31Z","git_url":"git://github.com/DenisRebenok/qna.git","ssh_url":"git@github.com:DenisRebenok/qna.git","clone_url":"https://github.com/DenisRebenok/qna.git","svn_url":"https://github.com/DenisRebenok/qna","homepage":"","size":119,"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/DenisRebenok/qna/pulls/7"},"html":{"href":"https://github.com/DenisRebenok/qna/pull/7"},"issue":{"href":"https://api.github.com/repos/DenisRebenok/qna/issues/7"},"comments":{"href":"https://api.github.com/repos/DenisRebenok/qna/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/DenisRebenok/qna/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/DenisRebenok/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DenisRebenok/qna/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/DenisRebenok/qna/statuses/a3492275330211784190acacfbd94d34f608add0"}}}}
{"actor":{"display_login":"vkurennov"}}