{"action":"created","comment":{"url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/comments/24714344","id":24714344,"diff_hunk":"@@ -0,0 +1,44 @@\n+require 'rails_helper'\n+\n+describe QuestionDecorator do\n+  include Draper::ViewHelpers\n+\n+  describe '#accepted_answer_owned_by_current_user?' do\n+    let(:author) { FactoryGirl.create(:user) }\n+    let(:visitor) { FactoryGirl.create(:user) }\n+    let(:question) { FactoryGirl.create(:question, user: author).decorate }\n+    let(:accepted_answer) { FactoryGirl.create(:answer, question: question) }\n+\n+    context 'answer is accepted' do\n+      before do\n+        question.accepted_answer_id = accepted_answer.id\n+        question.save\n+      end\n+\n+      context 'user owns question' do\n+        it 'should return true' do\n+          allow(h).to receive(:current_user).and_return(author)\n+          expect(question.accepted_answer_owned_by_current_user?).\n+            to be_true\n+        end\n+      end\n+\n+      context 'user does not own question' do\n+        it 'should return false' do","path":"spec/decorators/question_decorator_spec.rb","position":27,"original_position":27,"commit_id":"6bf2f927e4acc5a56ed0ab97154d8d63a4005726","original_commit_id":"6bf2f927e4acc5a56ed0ab97154d8d63a4005726","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-02-14T13:14:30Z","updated_at":"2015-02-14T13:14:30Z","html_url":"https://github.com/LaunchAcademy/event_horizon/pull/182#discussion_r24714344","pull_request_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/comments/24714344"},"html":{"href":"https://github.com/LaunchAcademy/event_horizon/pull/182#discussion_r24714344"},"pull_request":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182","id":29223465,"html_url":"https://github.com/LaunchAcademy/event_horizon/pull/182","diff_url":"https://github.com/LaunchAcademy/event_horizon/pull/182.diff","patch_url":"https://github.com/LaunchAcademy/event_horizon/pull/182.patch","issue_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/182","number":182,"state":"open","locked":false,"title":"RFR: bug fix, other users can't un-accept the best answer. [#88283752]","user":{"login":"SpencerCDixon","id":7471018,"avatar_url":"https://avatars.githubusercontent.com/u/7471018?v=3","gravatar_id":"","url":"https://api.github.com/users/SpencerCDixon","html_url":"https://github.com/SpencerCDixon","followers_url":"https://api.github.com/users/SpencerCDixon/followers","following_url":"https://api.github.com/users/SpencerCDixon/following{/other_user}","gists_url":"https://api.github.com/users/SpencerCDixon/gists{/gist_id}","starred_url":"https://api.github.com/users/SpencerCDixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpencerCDixon/subscriptions","organizations_url":"https://api.github.com/users/SpencerCDixon/orgs","repos_url":"https://api.github.com/users/SpencerCDixon/repos","events_url":"https://api.github.com/users/SpencerCDixon/events{/privacy}","received_events_url":"https://api.github.com/users/SpencerCDixon/received_events","type":"User","site_admin":false},"body":"...related to their question","created_at":"2015-02-12T22:37:40Z","updated_at":"2015-02-14T13:14:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc14456923d5c334d2a75576a088404c129bcd8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182/commits","review_comments_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182/comments","review_comment_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/182/comments","statuses_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/statuses/6bf2f927e4acc5a56ed0ab97154d8d63a4005726","head":{"label":"LaunchAcademy:sd-accepted-answer","ref":"sd-accepted-answer","sha":"6bf2f927e4acc5a56ed0ab97154d8d63a4005726","user":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?v=3","gravatar_id":"","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":21508679,"name":"event_horizon","full_name":"LaunchAcademy/event_horizon","owner":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?v=3","gravatar_id":"","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LaunchAcademy/event_horizon","description":"An application for displaying and submitting assignments and code review.","fork":false,"url":"https://api.github.com/repos/LaunchAcademy/event_horizon","forks_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/forks","keys_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/teams","hooks_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/hooks","issue_events_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/events{/number}","events_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/events","assignees_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/assignees{/user}","branches_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/branches{/branch}","tags_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/tags","blobs_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/statuses/{sha}","languages_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/languages","stargazers_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/stargazers","contributors_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/contributors","subscribers_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/subscribers","subscription_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/subscription","commits_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/comments/{number}","contents_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/contents/{+path}","compare_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/merges","archive_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/downloads","issues_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues{/number}","pulls_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls{/number}","milestones_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/milestones{/number}","notifications_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/labels{/name}","releases_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/releases{/id}","created_at":"2014-07-04T22:12:06Z","updated_at":"2015-02-13T16:29:39Z","pushed_at":"2015-02-14T13:14:27Z","git_url":"git://github.com/LaunchAcademy/event_horizon.git","ssh_url":"git@github.com:LaunchAcademy/event_horizon.git","clone_url":"https://github.com/LaunchAcademy/event_horizon.git","svn_url":"https://github.com/LaunchAcademy/event_horizon","homepage":null,"size":7078,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":34,"forks":5,"open_issues":34,"watchers":9,"default_branch":"master"}},"base":{"label":"LaunchAcademy:master","ref":"master","sha":"166cc317a62af687b40662a33f0e0fbfc0ff386a","user":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?v=3","gravatar_id":"","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":21508679,"name":"event_horizon","full_name":"LaunchAcademy/event_horizon","owner":{"login":"LaunchAcademy","id":3612691,"avatar_url":"https://avatars.githubusercontent.com/u/3612691?v=3","gravatar_id":"","url":"https://api.github.com/users/LaunchAcademy","html_url":"https://github.com/LaunchAcademy","followers_url":"https://api.github.com/users/LaunchAcademy/followers","following_url":"https://api.github.com/users/LaunchAcademy/following{/other_user}","gists_url":"https://api.github.com/users/LaunchAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/LaunchAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaunchAcademy/subscriptions","organizations_url":"https://api.github.com/users/LaunchAcademy/orgs","repos_url":"https://api.github.com/users/LaunchAcademy/repos","events_url":"https://api.github.com/users/LaunchAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/LaunchAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LaunchAcademy/event_horizon","description":"An application for displaying and submitting assignments and code review.","fork":false,"url":"https://api.github.com/repos/LaunchAcademy/event_horizon","forks_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/forks","keys_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/teams","hooks_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/hooks","issue_events_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/events{/number}","events_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/events","assignees_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/assignees{/user}","branches_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/branches{/branch}","tags_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/tags","blobs_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/statuses/{sha}","languages_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/languages","stargazers_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/stargazers","contributors_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/contributors","subscribers_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/subscribers","subscription_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/subscription","commits_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/comments/{number}","contents_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/contents/{+path}","compare_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/merges","archive_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/downloads","issues_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues{/number}","pulls_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls{/number}","milestones_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/milestones{/number}","notifications_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/labels{/name}","releases_url":"https://api.github.com/repos/LaunchAcademy/event_horizon/releases{/id}","created_at":"2014-07-04T22:12:06Z","updated_at":"2015-02-13T16:29:39Z","pushed_at":"2015-02-14T13:14:27Z","git_url":"git://github.com/LaunchAcademy/event_horizon.git","ssh_url":"git@github.com:LaunchAcademy/event_horizon.git","clone_url":"https://github.com/LaunchAcademy/event_horizon.git","svn_url":"https://github.com/LaunchAcademy/event_horizon","homepage":null,"size":7078,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":34,"forks":5,"open_issues":34,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182"},"html":{"href":"https://github.com/LaunchAcademy/event_horizon/pull/182"},"issue":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/182"},"comments":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/LaunchAcademy/event_horizon/statuses/6bf2f927e4acc5a56ed0ab97154d8d63a4005726"}}}}