{"action":"created","comment":{"url":"https://api.github.com/repos/videodanchik/think/pulls/comments/27371927","id":27371927,"diff_hunk":"@@ -33,10 +53,62 @@\n         expect { post :create, question_id: question, answer: attributes_for(:invalid_answer) }.to_not change(Answer, :count)\n       end\n \n-      it \"re-renders create view\" do\n+      it \"re-renders new view\" do\n         post :create, question_id: question, answer: attributes_for(:invalid_answer)\n         expect(response).to render_template :new\n       end\n     end\n   end\n+\n+  describe 'PATCH #update' do\n+     sign_in_user_for_answer\n+\n+    context 'with valid attributes' do\n+      it 'assigns the requested answer to @answer' do\n+        patch :update, id: answer, answer: attributes_for(:answer)\n+        expect(assigns(:answer)).to eq answer\n+      end\n+\n+      it 'changes answer attributes' do\n+        patch :update, id: answer, answer: { body: 'new body' }\n+        answer.reload\n+        expect(answer.body).to eq 'new body'\n+      end\n+\n+      it 'redirects to question page with updated answer' do\n+        patch :update, id: answer, answer: { body: 'new body' }\n+        answer.reload\n+        expect(response).to redirect_to question_path( answer.question_id )\n+      end\n+    end\n+\n+    context 'with invalid attributes' do\n+\n+      before { patch :update, id: answer, answer: { body: nil } }\n+\n+      it 'does not change answer attributes' do\n+        answer.reload\n+        expect(answer.body).not_to eq nil\n+      end\n+\n+      it 're-renders edit view' do\n+        expect(response).to render_template :edit\n+      end\n+    end\n+  end\n+\n+  describe 'DELETE #destroy' do","path":"spec/controllers/answers_controller_spec.rb","position":89,"original_position":89,"commit_id":"dd88790ca37ae4906a8c06d7c76bf694e4f69197","original_commit_id":"dd88790ca37ae4906a8c06d7c76bf694e4f69197","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":"Также нужен тест на то, когда не-автор пытается удалить ответ и не может этого сделать.","created_at":"2015-03-30T08:00:48Z","updated_at":"2015-03-30T08:00:48Z","html_url":"https://github.com/videodanchik/think/pull/3#discussion_r27371927","pull_request_url":"https://api.github.com/repos/videodanchik/think/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/videodanchik/think/pulls/comments/27371927"},"html":{"href":"https://github.com/videodanchik/think/pull/3#discussion_r27371927"},"pull_request":{"href":"https://api.github.com/repos/videodanchik/think/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/videodanchik/think/pulls/3","id":32185795,"html_url":"https://github.com/videodanchik/think/pull/3","diff_url":"https://github.com/videodanchik/think/pull/3.diff","patch_url":"https://github.com/videodanchik/think/pull/3.patch","issue_url":"https://api.github.com/repos/videodanchik/think/issues/3","number":3,"state":"open","locked":false,"title":"Lesson5","user":{"login":"videodanchik","id":10596393,"avatar_url":"https://avatars.githubusercontent.com/u/10596393?v=3","gravatar_id":"","url":"https://api.github.com/users/videodanchik","html_url":"https://github.com/videodanchik","followers_url":"https://api.github.com/users/videodanchik/followers","following_url":"https://api.github.com/users/videodanchik/following{/other_user}","gists_url":"https://api.github.com/users/videodanchik/gists{/gist_id}","starred_url":"https://api.github.com/users/videodanchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videodanchik/subscriptions","organizations_url":"https://api.github.com/users/videodanchik/orgs","repos_url":"https://api.github.com/users/videodanchik/repos","events_url":"https://api.github.com/users/videodanchik/events{/privacy}","received_events_url":"https://api.github.com/users/videodanchik/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-29T19:01:31Z","updated_at":"2015-03-30T08:00:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2b9a613018065805e3b466108c109473c185873","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/videodanchik/think/pulls/3/commits","review_comments_url":"https://api.github.com/repos/videodanchik/think/pulls/3/comments","review_comment_url":"https://api.github.com/repos/videodanchik/think/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videodanchik/think/issues/3/comments","statuses_url":"https://api.github.com/repos/videodanchik/think/statuses/dd88790ca37ae4906a8c06d7c76bf694e4f69197","head":{"label":"videodanchik:Lesson5","ref":"Lesson5","sha":"dd88790ca37ae4906a8c06d7c76bf694e4f69197","user":{"login":"videodanchik","id":10596393,"avatar_url":"https://avatars.githubusercontent.com/u/10596393?v=3","gravatar_id":"","url":"https://api.github.com/users/videodanchik","html_url":"https://github.com/videodanchik","followers_url":"https://api.github.com/users/videodanchik/followers","following_url":"https://api.github.com/users/videodanchik/following{/other_user}","gists_url":"https://api.github.com/users/videodanchik/gists{/gist_id}","starred_url":"https://api.github.com/users/videodanchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videodanchik/subscriptions","organizations_url":"https://api.github.com/users/videodanchik/orgs","repos_url":"https://api.github.com/users/videodanchik/repos","events_url":"https://api.github.com/users/videodanchik/events{/privacy}","received_events_url":"https://api.github.com/users/videodanchik/received_events","type":"User","site_admin":false},"repo":{"id":31982949,"name":"think","full_name":"videodanchik/think","owner":{"login":"videodanchik","id":10596393,"avatar_url":"https://avatars.githubusercontent.com/u/10596393?v=3","gravatar_id":"","url":"https://api.github.com/users/videodanchik","html_url":"https://github.com/videodanchik","followers_url":"https://api.github.com/users/videodanchik/followers","following_url":"https://api.github.com/users/videodanchik/following{/other_user}","gists_url":"https://api.github.com/users/videodanchik/gists{/gist_id}","starred_url":"https://api.github.com/users/videodanchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videodanchik/subscriptions","organizations_url":"https://api.github.com/users/videodanchik/orgs","repos_url":"https://api.github.com/users/videodanchik/repos","events_url":"https://api.github.com/users/videodanchik/events{/privacy}","received_events_url":"https://api.github.com/users/videodanchik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/videodanchik/think","description":"","fork":false,"url":"https://api.github.com/repos/videodanchik/think","forks_url":"https://api.github.com/repos/videodanchik/think/forks","keys_url":"https://api.github.com/repos/videodanchik/think/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videodanchik/think/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videodanchik/think/teams","hooks_url":"https://api.github.com/repos/videodanchik/think/hooks","issue_events_url":"https://api.github.com/repos/videodanchik/think/issues/events{/number}","events_url":"https://api.github.com/repos/videodanchik/think/events","assignees_url":"https://api.github.com/repos/videodanchik/think/assignees{/user}","branches_url":"https://api.github.com/repos/videodanchik/think/branches{/branch}","tags_url":"https://api.github.com/repos/videodanchik/think/tags","blobs_url":"https://api.github.com/repos/videodanchik/think/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videodanchik/think/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videodanchik/think/git/refs{/sha}","trees_url":"https://api.github.com/repos/videodanchik/think/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videodanchik/think/statuses/{sha}","languages_url":"https://api.github.com/repos/videodanchik/think/languages","stargazers_url":"https://api.github.com/repos/videodanchik/think/stargazers","contributors_url":"https://api.github.com/repos/videodanchik/think/contributors","subscribers_url":"https://api.github.com/repos/videodanchik/think/subscribers","subscription_url":"https://api.github.com/repos/videodanchik/think/subscription","commits_url":"https://api.github.com/repos/videodanchik/think/commits{/sha}","git_commits_url":"https://api.github.com/repos/videodanchik/think/git/commits{/sha}","comments_url":"https://api.github.com/repos/videodanchik/think/comments{/number}","issue_comment_url":"https://api.github.com/repos/videodanchik/think/issues/comments{/number}","contents_url":"https://api.github.com/repos/videodanchik/think/contents/{+path}","compare_url":"https://api.github.com/repos/videodanchik/think/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videodanchik/think/merges","archive_url":"https://api.github.com/repos/videodanchik/think/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videodanchik/think/downloads","issues_url":"https://api.github.com/repos/videodanchik/think/issues{/number}","pulls_url":"https://api.github.com/repos/videodanchik/think/pulls{/number}","milestones_url":"https://api.github.com/repos/videodanchik/think/milestones{/number}","notifications_url":"https://api.github.com/repos/videodanchik/think/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videodanchik/think/labels{/name}","releases_url":"https://api.github.com/repos/videodanchik/think/releases{/id}","created_at":"2015-03-10T21:31:49Z","updated_at":"2015-03-19T20:02:45Z","pushed_at":"2015-03-29T19:01:33Z","git_url":"git://github.com/videodanchik/think.git","ssh_url":"git@github.com:videodanchik/think.git","clone_url":"https://github.com/videodanchik/think.git","svn_url":"https://github.com/videodanchik/think","homepage":null,"size":228,"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":"videodanchik:master","ref":"master","sha":"1bf5586cd9c5d2e6a385b07d851b242326c704ad","user":{"login":"videodanchik","id":10596393,"avatar_url":"https://avatars.githubusercontent.com/u/10596393?v=3","gravatar_id":"","url":"https://api.github.com/users/videodanchik","html_url":"https://github.com/videodanchik","followers_url":"https://api.github.com/users/videodanchik/followers","following_url":"https://api.github.com/users/videodanchik/following{/other_user}","gists_url":"https://api.github.com/users/videodanchik/gists{/gist_id}","starred_url":"https://api.github.com/users/videodanchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videodanchik/subscriptions","organizations_url":"https://api.github.com/users/videodanchik/orgs","repos_url":"https://api.github.com/users/videodanchik/repos","events_url":"https://api.github.com/users/videodanchik/events{/privacy}","received_events_url":"https://api.github.com/users/videodanchik/received_events","type":"User","site_admin":false},"repo":{"id":31982949,"name":"think","full_name":"videodanchik/think","owner":{"login":"videodanchik","id":10596393,"avatar_url":"https://avatars.githubusercontent.com/u/10596393?v=3","gravatar_id":"","url":"https://api.github.com/users/videodanchik","html_url":"https://github.com/videodanchik","followers_url":"https://api.github.com/users/videodanchik/followers","following_url":"https://api.github.com/users/videodanchik/following{/other_user}","gists_url":"https://api.github.com/users/videodanchik/gists{/gist_id}","starred_url":"https://api.github.com/users/videodanchik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videodanchik/subscriptions","organizations_url":"https://api.github.com/users/videodanchik/orgs","repos_url":"https://api.github.com/users/videodanchik/repos","events_url":"https://api.github.com/users/videodanchik/events{/privacy}","received_events_url":"https://api.github.com/users/videodanchik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/videodanchik/think","description":"","fork":false,"url":"https://api.github.com/repos/videodanchik/think","forks_url":"https://api.github.com/repos/videodanchik/think/forks","keys_url":"https://api.github.com/repos/videodanchik/think/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videodanchik/think/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videodanchik/think/teams","hooks_url":"https://api.github.com/repos/videodanchik/think/hooks","issue_events_url":"https://api.github.com/repos/videodanchik/think/issues/events{/number}","events_url":"https://api.github.com/repos/videodanchik/think/events","assignees_url":"https://api.github.com/repos/videodanchik/think/assignees{/user}","branches_url":"https://api.github.com/repos/videodanchik/think/branches{/branch}","tags_url":"https://api.github.com/repos/videodanchik/think/tags","blobs_url":"https://api.github.com/repos/videodanchik/think/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videodanchik/think/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videodanchik/think/git/refs{/sha}","trees_url":"https://api.github.com/repos/videodanchik/think/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videodanchik/think/statuses/{sha}","languages_url":"https://api.github.com/repos/videodanchik/think/languages","stargazers_url":"https://api.github.com/repos/videodanchik/think/stargazers","contributors_url":"https://api.github.com/repos/videodanchik/think/contributors","subscribers_url":"https://api.github.com/repos/videodanchik/think/subscribers","subscription_url":"https://api.github.com/repos/videodanchik/think/subscription","commits_url":"https://api.github.com/repos/videodanchik/think/commits{/sha}","git_commits_url":"https://api.github.com/repos/videodanchik/think/git/commits{/sha}","comments_url":"https://api.github.com/repos/videodanchik/think/comments{/number}","issue_comment_url":"https://api.github.com/repos/videodanchik/think/issues/comments{/number}","contents_url":"https://api.github.com/repos/videodanchik/think/contents/{+path}","compare_url":"https://api.github.com/repos/videodanchik/think/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videodanchik/think/merges","archive_url":"https://api.github.com/repos/videodanchik/think/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videodanchik/think/downloads","issues_url":"https://api.github.com/repos/videodanchik/think/issues{/number}","pulls_url":"https://api.github.com/repos/videodanchik/think/pulls{/number}","milestones_url":"https://api.github.com/repos/videodanchik/think/milestones{/number}","notifications_url":"https://api.github.com/repos/videodanchik/think/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videodanchik/think/labels{/name}","releases_url":"https://api.github.com/repos/videodanchik/think/releases{/id}","created_at":"2015-03-10T21:31:49Z","updated_at":"2015-03-19T20:02:45Z","pushed_at":"2015-03-29T19:01:33Z","git_url":"git://github.com/videodanchik/think.git","ssh_url":"git@github.com:videodanchik/think.git","clone_url":"https://github.com/videodanchik/think.git","svn_url":"https://github.com/videodanchik/think","homepage":null,"size":228,"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/videodanchik/think/pulls/3"},"html":{"href":"https://github.com/videodanchik/think/pull/3"},"issue":{"href":"https://api.github.com/repos/videodanchik/think/issues/3"},"comments":{"href":"https://api.github.com/repos/videodanchik/think/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/videodanchik/think/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/videodanchik/think/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videodanchik/think/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/videodanchik/think/statuses/dd88790ca37ae4906a8c06d7c76bf694e4f69197"}}}}