{"action":"created","comment":{"url":"https://api.github.com/repos/max-underthesun/qna/pulls/comments/44857730","id":44857730,"diff_hunk":"@@ -0,0 +1,58 @@\n+require 'rails_helper'\n+\n+RSpec.describe AnswersController, type: :controller do\n+  let(:question) { create(:question) }\n+\n+  describe 'GET #new' do\n+    before { get :new, question_id: question }\n+\n+    it 'puts the question to the variable @question' do\n+      expect(assigns(:question)).to eq question\n+    end\n+\n+    it 'puts a new Answer in to the @answer' do\n+      expect(assigns(:answer)).to be_a_new(Answer)\n+    end\n+\n+    it 'render new view' do\n+      expect(response).to render_template :new\n+    end\n+  end\n+\n+  describe 'POST #create' do\n+    context 'with valid attributes' do\n+      it 'saves a new answer to the database' do\n+        expect {\n+          post :create, question_id: question,\n+                        answer: attributes_for(:answer, question_id: question)","path":"spec/controllers/answers_controller_spec.rb","position":27,"original_position":27,"commit_id":"aa505fddcc26f7166771056e783fda0c35521450","original_commit_id":"aa505fddcc26f7166771056e783fda0c35521450","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 передается question_id, он же отдельно передается перед этим. Значит, в answer он не нужен","created_at":"2015-11-14T11:48:13Z","updated_at":"2015-11-14T11:48:13Z","html_url":"https://github.com/max-underthesun/qna/pull/2#discussion_r44857730","pull_request_url":"https://api.github.com/repos/max-underthesun/qna/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/max-underthesun/qna/pulls/comments/44857730"},"html":{"href":"https://github.com/max-underthesun/qna/pull/2#discussion_r44857730"},"pull_request":{"href":"https://api.github.com/repos/max-underthesun/qna/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/max-underthesun/qna/pulls/2","id":50720261,"html_url":"https://github.com/max-underthesun/qna/pull/2","diff_url":"https://github.com/max-underthesun/qna/pull/2.diff","patch_url":"https://github.com/max-underthesun/qna/pull/2.patch","issue_url":"https://api.github.com/repos/max-underthesun/qna/issues/2","number":2,"state":"open","locked":false,"title":"задание по занятию №4","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"body":"Реализовал истории:\r\n\"Пользователь может создавать вопрос\". (Без аутентификации)\r\n\"Пользователь может создавать ответ на вопрос\".\r\n\r\nВьюхи не стал включать в пулл-реквест, занимаюсь ими отдельно и, как я понимаю, они и не нужны в рамках задания.","created_at":"2015-11-14T09:31:49Z","updated_at":"2015-11-14T11:48:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc4ed170c62d9f712d9bbeb4dbddcf7b54d0cc76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/max-underthesun/qna/pulls/2/commits","review_comments_url":"https://api.github.com/repos/max-underthesun/qna/pulls/2/comments","review_comment_url":"https://api.github.com/repos/max-underthesun/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/max-underthesun/qna/issues/2/comments","statuses_url":"https://api.github.com/repos/max-underthesun/qna/statuses/aa505fddcc26f7166771056e783fda0c35521450","head":{"label":"max-underthesun:finish_l4","ref":"finish_l4","sha":"aa505fddcc26f7166771056e783fda0c35521450","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"repo":{"id":45785229,"name":"qna","full_name":"max-underthesun/qna","owner":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/max-underthesun/qna","description":"","fork":false,"url":"https://api.github.com/repos/max-underthesun/qna","forks_url":"https://api.github.com/repos/max-underthesun/qna/forks","keys_url":"https://api.github.com/repos/max-underthesun/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/max-underthesun/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/max-underthesun/qna/teams","hooks_url":"https://api.github.com/repos/max-underthesun/qna/hooks","issue_events_url":"https://api.github.com/repos/max-underthesun/qna/issues/events{/number}","events_url":"https://api.github.com/repos/max-underthesun/qna/events","assignees_url":"https://api.github.com/repos/max-underthesun/qna/assignees{/user}","branches_url":"https://api.github.com/repos/max-underthesun/qna/branches{/branch}","tags_url":"https://api.github.com/repos/max-underthesun/qna/tags","blobs_url":"https://api.github.com/repos/max-underthesun/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/max-underthesun/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/max-underthesun/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/max-underthesun/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/max-underthesun/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/max-underthesun/qna/languages","stargazers_url":"https://api.github.com/repos/max-underthesun/qna/stargazers","contributors_url":"https://api.github.com/repos/max-underthesun/qna/contributors","subscribers_url":"https://api.github.com/repos/max-underthesun/qna/subscribers","subscription_url":"https://api.github.com/repos/max-underthesun/qna/subscription","commits_url":"https://api.github.com/repos/max-underthesun/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/max-underthesun/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/max-underthesun/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/max-underthesun/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/max-underthesun/qna/contents/{+path}","compare_url":"https://api.github.com/repos/max-underthesun/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/max-underthesun/qna/merges","archive_url":"https://api.github.com/repos/max-underthesun/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/max-underthesun/qna/downloads","issues_url":"https://api.github.com/repos/max-underthesun/qna/issues{/number}","pulls_url":"https://api.github.com/repos/max-underthesun/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/max-underthesun/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/max-underthesun/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/max-underthesun/qna/labels{/name}","releases_url":"https://api.github.com/repos/max-underthesun/qna/releases{/id}","created_at":"2015-11-08T15:05:35Z","updated_at":"2015-11-08T15:11:44Z","pushed_at":"2015-11-14T11:39:44Z","git_url":"git://github.com/max-underthesun/qna.git","ssh_url":"git@github.com:max-underthesun/qna.git","clone_url":"https://github.com/max-underthesun/qna.git","svn_url":"https://github.com/max-underthesun/qna","homepage":null,"size":0,"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":"max-underthesun:master","ref":"master","sha":"4f7772b0f68f8136992a43c37cb5c0834ff8ea24","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"repo":{"id":45785229,"name":"qna","full_name":"max-underthesun/qna","owner":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/max-underthesun/qna","description":"","fork":false,"url":"https://api.github.com/repos/max-underthesun/qna","forks_url":"https://api.github.com/repos/max-underthesun/qna/forks","keys_url":"https://api.github.com/repos/max-underthesun/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/max-underthesun/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/max-underthesun/qna/teams","hooks_url":"https://api.github.com/repos/max-underthesun/qna/hooks","issue_events_url":"https://api.github.com/repos/max-underthesun/qna/issues/events{/number}","events_url":"https://api.github.com/repos/max-underthesun/qna/events","assignees_url":"https://api.github.com/repos/max-underthesun/qna/assignees{/user}","branches_url":"https://api.github.com/repos/max-underthesun/qna/branches{/branch}","tags_url":"https://api.github.com/repos/max-underthesun/qna/tags","blobs_url":"https://api.github.com/repos/max-underthesun/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/max-underthesun/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/max-underthesun/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/max-underthesun/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/max-underthesun/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/max-underthesun/qna/languages","stargazers_url":"https://api.github.com/repos/max-underthesun/qna/stargazers","contributors_url":"https://api.github.com/repos/max-underthesun/qna/contributors","subscribers_url":"https://api.github.com/repos/max-underthesun/qna/subscribers","subscription_url":"https://api.github.com/repos/max-underthesun/qna/subscription","commits_url":"https://api.github.com/repos/max-underthesun/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/max-underthesun/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/max-underthesun/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/max-underthesun/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/max-underthesun/qna/contents/{+path}","compare_url":"https://api.github.com/repos/max-underthesun/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/max-underthesun/qna/merges","archive_url":"https://api.github.com/repos/max-underthesun/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/max-underthesun/qna/downloads","issues_url":"https://api.github.com/repos/max-underthesun/qna/issues{/number}","pulls_url":"https://api.github.com/repos/max-underthesun/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/max-underthesun/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/max-underthesun/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/max-underthesun/qna/labels{/name}","releases_url":"https://api.github.com/repos/max-underthesun/qna/releases{/id}","created_at":"2015-11-08T15:05:35Z","updated_at":"2015-11-08T15:11:44Z","pushed_at":"2015-11-14T11:39:44Z","git_url":"git://github.com/max-underthesun/qna.git","ssh_url":"git@github.com:max-underthesun/qna.git","clone_url":"https://github.com/max-underthesun/qna.git","svn_url":"https://github.com/max-underthesun/qna","homepage":null,"size":0,"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/max-underthesun/qna/pulls/2"},"html":{"href":"https://github.com/max-underthesun/qna/pull/2"},"issue":{"href":"https://api.github.com/repos/max-underthesun/qna/issues/2"},"comments":{"href":"https://api.github.com/repos/max-underthesun/qna/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/max-underthesun/qna/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/max-underthesun/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/max-underthesun/qna/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/max-underthesun/qna/statuses/aa505fddcc26f7166771056e783fda0c35521450"}}}}