{"action":"created","comment":{"url":"https://api.github.com/repos/dx0x58/qnapp/pulls/comments/26558919","id":26558919,"diff_hunk":"@@ -0,0 +1,23 @@\n+require 'rails_helper'\n+\n+RSpec.describe Question, type: :model do\n+  it { should validate_presence_of :title }\n+  it { should validate_presence_of :body }\n+\n+  it { should have_many(:answers).dependent(:destroy) }\n+\n+  describe \"create question\" do\n+    it \"should create question\" do\n+      create(:question)\n+      expect(Question.count).to eq(1)\n+    end\n+  end\n+\n+  describe \"delete question\" do","path":"spec/models/question_spec.rb","position":16,"original_position":16,"commit_id":"46d0b3359d4420ca93c652e62a1cc22d35e2d698","original_commit_id":"46d0b3359d4420ca93c652e62a1cc22d35e2d698","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":"Также лишний тест. Что мы здесь проверяем? То, что `destroy` удаляет объект, то есть мы опять тестируем сам фреймворк. Мы доверяем инструментам, которые используем. Если хочется убедиться, что в фреймворке или библиотеке все работает, как заявлено - клонируем репозиторий и запускаем тесты этой библиотеки/фреймворка. Но когда мы пишем свое приложение, мы считаем, что инструменты работают так, как надо и тестируем только свой код, тот который мы пишем. Это очень важно осознать и применять на практике, иначе можно бесконечно тестировать код библиотек/фреймворка и не написать ни строчки своего кода.","created_at":"2015-03-17T09:33:27Z","updated_at":"2015-03-17T09:33:27Z","html_url":"https://github.com/dx0x58/qnapp/pull/1#discussion_r26558919","pull_request_url":"https://api.github.com/repos/dx0x58/qnapp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dx0x58/qnapp/pulls/comments/26558919"},"html":{"href":"https://github.com/dx0x58/qnapp/pull/1#discussion_r26558919"},"pull_request":{"href":"https://api.github.com/repos/dx0x58/qnapp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dx0x58/qnapp/pulls/1","id":31290137,"html_url":"https://github.com/dx0x58/qnapp/pull/1","diff_url":"https://github.com/dx0x58/qnapp/pull/1.diff","patch_url":"https://github.com/dx0x58/qnapp/pull/1.patch","issue_url":"https://api.github.com/repos/dx0x58/qnapp/issues/1","number":1,"state":"open","locked":false,"title":"Lesson 1","user":{"login":"dx0x58","id":3293970,"avatar_url":"https://avatars.githubusercontent.com/u/3293970?v=3","gravatar_id":"","url":"https://api.github.com/users/dx0x58","html_url":"https://github.com/dx0x58","followers_url":"https://api.github.com/users/dx0x58/followers","following_url":"https://api.github.com/users/dx0x58/following{/other_user}","gists_url":"https://api.github.com/users/dx0x58/gists{/gist_id}","starred_url":"https://api.github.com/users/dx0x58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dx0x58/subscriptions","organizations_url":"https://api.github.com/users/dx0x58/orgs","repos_url":"https://api.github.com/users/dx0x58/repos","events_url":"https://api.github.com/users/dx0x58/events{/privacy}","received_events_url":"https://api.github.com/users/dx0x58/received_events","type":"User","site_admin":false},"body":"В тестах проверяются валидации, связи моделей Answer и Question, создание и удаление с учетом  dependent: :destroy","created_at":"2015-03-16T22:14:36Z","updated_at":"2015-03-17T09:33:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d92a167e9e60943e07a6c10474b705168d73ca7f","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/dx0x58/qnapp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dx0x58/qnapp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dx0x58/qnapp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dx0x58/qnapp/issues/1/comments","statuses_url":"https://api.github.com/repos/dx0x58/qnapp/statuses/46d0b3359d4420ca93c652e62a1cc22d35e2d698","head":{"label":"dx0x58:lesson_1","ref":"lesson_1","sha":"46d0b3359d4420ca93c652e62a1cc22d35e2d698","user":{"login":"dx0x58","id":3293970,"avatar_url":"https://avatars.githubusercontent.com/u/3293970?v=3","gravatar_id":"","url":"https://api.github.com/users/dx0x58","html_url":"https://github.com/dx0x58","followers_url":"https://api.github.com/users/dx0x58/followers","following_url":"https://api.github.com/users/dx0x58/following{/other_user}","gists_url":"https://api.github.com/users/dx0x58/gists{/gist_id}","starred_url":"https://api.github.com/users/dx0x58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dx0x58/subscriptions","organizations_url":"https://api.github.com/users/dx0x58/orgs","repos_url":"https://api.github.com/users/dx0x58/repos","events_url":"https://api.github.com/users/dx0x58/events{/privacy}","received_events_url":"https://api.github.com/users/dx0x58/received_events","type":"User","site_admin":false},"repo":{"id":32284293,"name":"qnapp","full_name":"dx0x58/qnapp","owner":{"login":"dx0x58","id":3293970,"avatar_url":"https://avatars.githubusercontent.com/u/3293970?v=3","gravatar_id":"","url":"https://api.github.com/users/dx0x58","html_url":"https://github.com/dx0x58","followers_url":"https://api.github.com/users/dx0x58/followers","following_url":"https://api.github.com/users/dx0x58/following{/other_user}","gists_url":"https://api.github.com/users/dx0x58/gists{/gist_id}","starred_url":"https://api.github.com/users/dx0x58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dx0x58/subscriptions","organizations_url":"https://api.github.com/users/dx0x58/orgs","repos_url":"https://api.github.com/users/dx0x58/repos","events_url":"https://api.github.com/users/dx0x58/events{/privacy}","received_events_url":"https://api.github.com/users/dx0x58/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dx0x58/qnapp","description":"SO like app :3","fork":false,"url":"https://api.github.com/repos/dx0x58/qnapp","forks_url":"https://api.github.com/repos/dx0x58/qnapp/forks","keys_url":"https://api.github.com/repos/dx0x58/qnapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dx0x58/qnapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dx0x58/qnapp/teams","hooks_url":"https://api.github.com/repos/dx0x58/qnapp/hooks","issue_events_url":"https://api.github.com/repos/dx0x58/qnapp/issues/events{/number}","events_url":"https://api.github.com/repos/dx0x58/qnapp/events","assignees_url":"https://api.github.com/repos/dx0x58/qnapp/assignees{/user}","branches_url":"https://api.github.com/repos/dx0x58/qnapp/branches{/branch}","tags_url":"https://api.github.com/repos/dx0x58/qnapp/tags","blobs_url":"https://api.github.com/repos/dx0x58/qnapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dx0x58/qnapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dx0x58/qnapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dx0x58/qnapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dx0x58/qnapp/statuses/{sha}","languages_url":"https://api.github.com/repos/dx0x58/qnapp/languages","stargazers_url":"https://api.github.com/repos/dx0x58/qnapp/stargazers","contributors_url":"https://api.github.com/repos/dx0x58/qnapp/contributors","subscribers_url":"https://api.github.com/repos/dx0x58/qnapp/subscribers","subscription_url":"https://api.github.com/repos/dx0x58/qnapp/subscription","commits_url":"https://api.github.com/repos/dx0x58/qnapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dx0x58/qnapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dx0x58/qnapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dx0x58/qnapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dx0x58/qnapp/contents/{+path}","compare_url":"https://api.github.com/repos/dx0x58/qnapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dx0x58/qnapp/merges","archive_url":"https://api.github.com/repos/dx0x58/qnapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dx0x58/qnapp/downloads","issues_url":"https://api.github.com/repos/dx0x58/qnapp/issues{/number}","pulls_url":"https://api.github.com/repos/dx0x58/qnapp/pulls{/number}","milestones_url":"https://api.github.com/repos/dx0x58/qnapp/milestones{/number}","notifications_url":"https://api.github.com/repos/dx0x58/qnapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dx0x58/qnapp/labels{/name}","releases_url":"https://api.github.com/repos/dx0x58/qnapp/releases{/id}","created_at":"2015-03-15T21:11:12Z","updated_at":"2015-03-15T21:14:38Z","pushed_at":"2015-03-16T22:11:06Z","git_url":"git://github.com/dx0x58/qnapp.git","ssh_url":"git@github.com:dx0x58/qnapp.git","clone_url":"https://github.com/dx0x58/qnapp.git","svn_url":"https://github.com/dx0x58/qnapp","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":"dx0x58:master","ref":"master","sha":"cc09fac557080d932d535abaff24336523447199","user":{"login":"dx0x58","id":3293970,"avatar_url":"https://avatars.githubusercontent.com/u/3293970?v=3","gravatar_id":"","url":"https://api.github.com/users/dx0x58","html_url":"https://github.com/dx0x58","followers_url":"https://api.github.com/users/dx0x58/followers","following_url":"https://api.github.com/users/dx0x58/following{/other_user}","gists_url":"https://api.github.com/users/dx0x58/gists{/gist_id}","starred_url":"https://api.github.com/users/dx0x58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dx0x58/subscriptions","organizations_url":"https://api.github.com/users/dx0x58/orgs","repos_url":"https://api.github.com/users/dx0x58/repos","events_url":"https://api.github.com/users/dx0x58/events{/privacy}","received_events_url":"https://api.github.com/users/dx0x58/received_events","type":"User","site_admin":false},"repo":{"id":32284293,"name":"qnapp","full_name":"dx0x58/qnapp","owner":{"login":"dx0x58","id":3293970,"avatar_url":"https://avatars.githubusercontent.com/u/3293970?v=3","gravatar_id":"","url":"https://api.github.com/users/dx0x58","html_url":"https://github.com/dx0x58","followers_url":"https://api.github.com/users/dx0x58/followers","following_url":"https://api.github.com/users/dx0x58/following{/other_user}","gists_url":"https://api.github.com/users/dx0x58/gists{/gist_id}","starred_url":"https://api.github.com/users/dx0x58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dx0x58/subscriptions","organizations_url":"https://api.github.com/users/dx0x58/orgs","repos_url":"https://api.github.com/users/dx0x58/repos","events_url":"https://api.github.com/users/dx0x58/events{/privacy}","received_events_url":"https://api.github.com/users/dx0x58/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dx0x58/qnapp","description":"SO like app :3","fork":false,"url":"https://api.github.com/repos/dx0x58/qnapp","forks_url":"https://api.github.com/repos/dx0x58/qnapp/forks","keys_url":"https://api.github.com/repos/dx0x58/qnapp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dx0x58/qnapp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dx0x58/qnapp/teams","hooks_url":"https://api.github.com/repos/dx0x58/qnapp/hooks","issue_events_url":"https://api.github.com/repos/dx0x58/qnapp/issues/events{/number}","events_url":"https://api.github.com/repos/dx0x58/qnapp/events","assignees_url":"https://api.github.com/repos/dx0x58/qnapp/assignees{/user}","branches_url":"https://api.github.com/repos/dx0x58/qnapp/branches{/branch}","tags_url":"https://api.github.com/repos/dx0x58/qnapp/tags","blobs_url":"https://api.github.com/repos/dx0x58/qnapp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dx0x58/qnapp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dx0x58/qnapp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dx0x58/qnapp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dx0x58/qnapp/statuses/{sha}","languages_url":"https://api.github.com/repos/dx0x58/qnapp/languages","stargazers_url":"https://api.github.com/repos/dx0x58/qnapp/stargazers","contributors_url":"https://api.github.com/repos/dx0x58/qnapp/contributors","subscribers_url":"https://api.github.com/repos/dx0x58/qnapp/subscribers","subscription_url":"https://api.github.com/repos/dx0x58/qnapp/subscription","commits_url":"https://api.github.com/repos/dx0x58/qnapp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dx0x58/qnapp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dx0x58/qnapp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dx0x58/qnapp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dx0x58/qnapp/contents/{+path}","compare_url":"https://api.github.com/repos/dx0x58/qnapp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dx0x58/qnapp/merges","archive_url":"https://api.github.com/repos/dx0x58/qnapp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dx0x58/qnapp/downloads","issues_url":"https://api.github.com/repos/dx0x58/qnapp/issues{/number}","pulls_url":"https://api.github.com/repos/dx0x58/qnapp/pulls{/number}","milestones_url":"https://api.github.com/repos/dx0x58/qnapp/milestones{/number}","notifications_url":"https://api.github.com/repos/dx0x58/qnapp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dx0x58/qnapp/labels{/name}","releases_url":"https://api.github.com/repos/dx0x58/qnapp/releases{/id}","created_at":"2015-03-15T21:11:12Z","updated_at":"2015-03-15T21:14:38Z","pushed_at":"2015-03-16T22:11:06Z","git_url":"git://github.com/dx0x58/qnapp.git","ssh_url":"git@github.com:dx0x58/qnapp.git","clone_url":"https://github.com/dx0x58/qnapp.git","svn_url":"https://github.com/dx0x58/qnapp","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/dx0x58/qnapp/pulls/1"},"html":{"href":"https://github.com/dx0x58/qnapp/pull/1"},"issue":{"href":"https://api.github.com/repos/dx0x58/qnapp/issues/1"},"comments":{"href":"https://api.github.com/repos/dx0x58/qnapp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dx0x58/qnapp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dx0x58/qnapp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dx0x58/qnapp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dx0x58/qnapp/statuses/46d0b3359d4420ca93c652e62a1cc22d35e2d698"}}}}