{"action":"created","comment":{"url":"https://api.github.com/repos/Backstabe/qna/pulls/comments/27353065","id":27353065,"diff_hunk":"@@ -7,26 +7,27 @@\n } do\n \n   given(:user){ create(:user) }\n-  given(:question) { create(:question) }\n+  given!(:question) { create(:question) }\n \n-  scenario 'User create an answer to the question' do\n+  scenario 'User create an answer to the question', js: true do\n     sign_in(user)\n \n-    answer = attributes_for(:answer, question: question.id, user: user.id)\n-    visit question_path(question.id)\n-    click_on 'Add answer'\n-    fill_in 'Body', with: answer[:body]\n-    click_on 'Create'\n+    visit question_path(question)\n+    expect(page).to_not have_selector(:link_or_button, 'Login for create answer')\n+\n+    fill_in 'Your answer', with: 'My answer'\n+    click_on 'Create answer'\n \n-    expect(page).to have_content \"Answer created\"\n-    expect(page).to have_content question.title\n-    expect(page).to have_content answer[:body]\n+    expect(current_path).to eq question_path(question)\n+    within '#answers' do\n+      expect(page).to have_content 'My answer'\n+    end\n   end\n \n   scenario 'Guest can not answer a question' do\n     visit question_path(question.id)\n-    click_on 'Add answer'\n-    expect(page).to have_content 'You need to sign in or sign up before continuing.'\n+    click_on 'Login for create answer'","path":"spec/acceptance/create_answers_spec.rb","position":35,"original_position":35,"commit_id":"3b174cdaed0c99466dd588e863b6c42799e01bbd","original_commit_id":"3b174cdaed0c99466dd588e863b6c42799e01bbd","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"body":"Здесь достаточно проверить, что такая кнопка есть. Кликать на нее не обязательно.","created_at":"2015-03-29T09:48:35Z","updated_at":"2015-03-29T09:48:35Z","html_url":"https://github.com/Backstabe/qna/pull/19#discussion_r27353065","pull_request_url":"https://api.github.com/repos/Backstabe/qna/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/comments/27353065"},"html":{"href":"https://github.com/Backstabe/qna/pull/19#discussion_r27353065"},"pull_request":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/Backstabe/qna/pulls/19","id":32165975,"html_url":"https://github.com/Backstabe/qna/pull/19","diff_url":"https://github.com/Backstabe/qna/pull/19.diff","patch_url":"https://github.com/Backstabe/qna/pull/19.patch","issue_url":"https://api.github.com/repos/Backstabe/qna/issues/19","number":19,"state":"open","locked":false,"title":"Lesson6","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"body":"Реализовал добавление ответов к вопросам через ajax и вложенные ресурсы, покрыть все тестами.","created_at":"2015-03-28T15:27:35Z","updated_at":"2015-03-29T09:48:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed65664c41832dfa127abc64b3eaf35375939af3","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Backstabe/qna/pulls/19/commits","review_comments_url":"https://api.github.com/repos/Backstabe/qna/pulls/19/comments","review_comment_url":"https://api.github.com/repos/Backstabe/qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Backstabe/qna/issues/19/comments","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/3b174cdaed0c99466dd588e863b6c42799e01bbd","head":{"label":"Backstabe:lesson6","ref":"lesson6","sha":"3b174cdaed0c99466dd588e863b6c42799e01bbd","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"repo":{"id":31914892,"name":"qna","full_name":"Backstabe/qna","owner":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Backstabe/qna","description":"учебный репозиторий","fork":false,"url":"https://api.github.com/repos/Backstabe/qna","forks_url":"https://api.github.com/repos/Backstabe/qna/forks","keys_url":"https://api.github.com/repos/Backstabe/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Backstabe/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Backstabe/qna/teams","hooks_url":"https://api.github.com/repos/Backstabe/qna/hooks","issue_events_url":"https://api.github.com/repos/Backstabe/qna/issues/events{/number}","events_url":"https://api.github.com/repos/Backstabe/qna/events","assignees_url":"https://api.github.com/repos/Backstabe/qna/assignees{/user}","branches_url":"https://api.github.com/repos/Backstabe/qna/branches{/branch}","tags_url":"https://api.github.com/repos/Backstabe/qna/tags","blobs_url":"https://api.github.com/repos/Backstabe/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Backstabe/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Backstabe/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/Backstabe/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/Backstabe/qna/languages","stargazers_url":"https://api.github.com/repos/Backstabe/qna/stargazers","contributors_url":"https://api.github.com/repos/Backstabe/qna/contributors","subscribers_url":"https://api.github.com/repos/Backstabe/qna/subscribers","subscription_url":"https://api.github.com/repos/Backstabe/qna/subscription","commits_url":"https://api.github.com/repos/Backstabe/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/Backstabe/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/Backstabe/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/Backstabe/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/Backstabe/qna/contents/{+path}","compare_url":"https://api.github.com/repos/Backstabe/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Backstabe/qna/merges","archive_url":"https://api.github.com/repos/Backstabe/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Backstabe/qna/downloads","issues_url":"https://api.github.com/repos/Backstabe/qna/issues{/number}","pulls_url":"https://api.github.com/repos/Backstabe/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/Backstabe/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/Backstabe/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Backstabe/qna/labels{/name}","releases_url":"https://api.github.com/repos/Backstabe/qna/releases{/id}","created_at":"2015-03-09T18:20:11Z","updated_at":"2015-03-27T07:13:52Z","pushed_at":"2015-03-28T15:27:36Z","git_url":"git://github.com/Backstabe/qna.git","ssh_url":"git@github.com:Backstabe/qna.git","clone_url":"https://github.com/Backstabe/qna.git","svn_url":"https://github.com/Backstabe/qna","homepage":null,"size":316,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"Backstabe:master","ref":"master","sha":"eccdd93d81b8f0bf2ec844e092412f50bad551a3","user":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"repo":{"id":31914892,"name":"qna","full_name":"Backstabe/qna","owner":{"login":"Backstabe","id":3023969,"avatar_url":"https://avatars.githubusercontent.com/u/3023969?v=3","gravatar_id":"","url":"https://api.github.com/users/Backstabe","html_url":"https://github.com/Backstabe","followers_url":"https://api.github.com/users/Backstabe/followers","following_url":"https://api.github.com/users/Backstabe/following{/other_user}","gists_url":"https://api.github.com/users/Backstabe/gists{/gist_id}","starred_url":"https://api.github.com/users/Backstabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Backstabe/subscriptions","organizations_url":"https://api.github.com/users/Backstabe/orgs","repos_url":"https://api.github.com/users/Backstabe/repos","events_url":"https://api.github.com/users/Backstabe/events{/privacy}","received_events_url":"https://api.github.com/users/Backstabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Backstabe/qna","description":"учебный репозиторий","fork":false,"url":"https://api.github.com/repos/Backstabe/qna","forks_url":"https://api.github.com/repos/Backstabe/qna/forks","keys_url":"https://api.github.com/repos/Backstabe/qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Backstabe/qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Backstabe/qna/teams","hooks_url":"https://api.github.com/repos/Backstabe/qna/hooks","issue_events_url":"https://api.github.com/repos/Backstabe/qna/issues/events{/number}","events_url":"https://api.github.com/repos/Backstabe/qna/events","assignees_url":"https://api.github.com/repos/Backstabe/qna/assignees{/user}","branches_url":"https://api.github.com/repos/Backstabe/qna/branches{/branch}","tags_url":"https://api.github.com/repos/Backstabe/qna/tags","blobs_url":"https://api.github.com/repos/Backstabe/qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Backstabe/qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Backstabe/qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/Backstabe/qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Backstabe/qna/statuses/{sha}","languages_url":"https://api.github.com/repos/Backstabe/qna/languages","stargazers_url":"https://api.github.com/repos/Backstabe/qna/stargazers","contributors_url":"https://api.github.com/repos/Backstabe/qna/contributors","subscribers_url":"https://api.github.com/repos/Backstabe/qna/subscribers","subscription_url":"https://api.github.com/repos/Backstabe/qna/subscription","commits_url":"https://api.github.com/repos/Backstabe/qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/Backstabe/qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/Backstabe/qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/Backstabe/qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/Backstabe/qna/contents/{+path}","compare_url":"https://api.github.com/repos/Backstabe/qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Backstabe/qna/merges","archive_url":"https://api.github.com/repos/Backstabe/qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Backstabe/qna/downloads","issues_url":"https://api.github.com/repos/Backstabe/qna/issues{/number}","pulls_url":"https://api.github.com/repos/Backstabe/qna/pulls{/number}","milestones_url":"https://api.github.com/repos/Backstabe/qna/milestones{/number}","notifications_url":"https://api.github.com/repos/Backstabe/qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Backstabe/qna/labels{/name}","releases_url":"https://api.github.com/repos/Backstabe/qna/releases{/id}","created_at":"2015-03-09T18:20:11Z","updated_at":"2015-03-27T07:13:52Z","pushed_at":"2015-03-28T15:27:36Z","git_url":"git://github.com/Backstabe/qna.git","ssh_url":"git@github.com:Backstabe/qna.git","clone_url":"https://github.com/Backstabe/qna.git","svn_url":"https://github.com/Backstabe/qna","homepage":null,"size":316,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/19"},"html":{"href":"https://github.com/Backstabe/qna/pull/19"},"issue":{"href":"https://api.github.com/repos/Backstabe/qna/issues/19"},"comments":{"href":"https://api.github.com/repos/Backstabe/qna/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Backstabe/qna/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/Backstabe/qna/statuses/3b174cdaed0c99466dd588e863b6c42799e01bbd"}}}}