{"action":"created","comment":{"url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/comments/26164391","id":26164391,"diff_hunk":"@@ -0,0 +1,5 @@\n+class Answer < ActiveRecord::Base\n+  belongs_to :question, dependent: :destroy","path":"app/models/answer.rb","position":2,"original_position":2,"commit_id":"f1b2ff164d7c8705dc4f88697dc143a2e710951d","original_commit_id":"f1b2ff164d7c8705dc4f88697dc143a2e710951d","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"body":"Не получается пока (\r\n\r\nВ текущем варианте\r\n    question1 = FactoryGirl.create(:question)\r\n    answer1   = FactoryGirl.create(:answer, question_id: :question1)\r\n    answer2   = FactoryGirl.create(:answer, question_id: :question1)\r\n\r\n    it \"should destroy dependent answers\" do\r\n      expect { question1.destroy }.to change{ Answer.count }.from(2).to(0)\r\n    end\r\n\r\nесть две проблемы:\r\n1. кол-во ответов не меняется после удаления вопроса:\r\nexpected result to have changed from 2 to 0, but did not change\r\n\r\n2. необходимо выполнять rake db:test:prepare после каждого вызова rspec\r\n","created_at":"2015-03-10T20:49:07Z","updated_at":"2015-03-10T20:49:07Z","html_url":"https://github.com/anatoly-cmdx/stackoverflow/pull/28#discussion_r26164391","pull_request_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/comments/26164391"},"html":{"href":"https://github.com/anatoly-cmdx/stackoverflow/pull/28#discussion_r26164391"},"pull_request":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28","id":30881386,"html_url":"https://github.com/anatoly-cmdx/stackoverflow/pull/28","diff_url":"https://github.com/anatoly-cmdx/stackoverflow/pull/28.diff","patch_url":"https://github.com/anatoly-cmdx/stackoverflow/pull/28.patch","issue_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/28","number":28,"state":"open","locked":false,"title":"Задание 3: Создать модели Вопроса и Ответа и тесты для них","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"body":"Answer\r\n  should require title to be set\r\n  should require body to be set\r\n  should belong to question\r\n\r\nQuestion\r\n  should require title to be set\r\n  should require body to be set\r\n","created_at":"2015-03-10T18:57:08Z","updated_at":"2015-03-10T20:49:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f787081d69d43615e397fcabe0242e27979debf6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28/commits","review_comments_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28/comments","review_comment_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/28/comments","statuses_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/statuses/f1b2ff164d7c8705dc4f88697dc143a2e710951d","head":{"label":"anatoly-cmdx:models_qna","ref":"models_qna","sha":"f1b2ff164d7c8705dc4f88697dc143a2e710951d","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"repo":{"id":31970791,"name":"stackoverflow","full_name":"anatoly-cmdx/stackoverflow","owner":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anatoly-cmdx/stackoverflow","description":"","fork":false,"url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow","forks_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/forks","keys_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/teams","hooks_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/hooks","issue_events_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/events{/number}","events_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/events","assignees_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/assignees{/user}","branches_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/branches{/branch}","tags_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/tags","blobs_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/languages","stargazers_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/stargazers","contributors_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/contributors","subscribers_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/subscribers","subscription_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/subscription","commits_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/contents/{+path}","compare_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/merges","archive_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/downloads","issues_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues{/number}","pulls_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/labels{/name}","releases_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/releases{/id}","created_at":"2015-03-10T17:14:43Z","updated_at":"2015-03-10T17:15:57Z","pushed_at":"2015-03-10T19:16:34Z","git_url":"git://github.com/anatoly-cmdx/stackoverflow.git","ssh_url":"git@github.com:anatoly-cmdx/stackoverflow.git","clone_url":"https://github.com/anatoly-cmdx/stackoverflow.git","svn_url":"https://github.com/anatoly-cmdx/stackoverflow","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":28,"forks":0,"open_issues":28,"watchers":0,"default_branch":"master"}},"base":{"label":"anatoly-cmdx:master","ref":"master","sha":"89c027c655e8929d067caece41b86710a9c25620","user":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"repo":{"id":31970791,"name":"stackoverflow","full_name":"anatoly-cmdx/stackoverflow","owner":{"login":"anatoly-cmdx","id":10254612,"avatar_url":"https://avatars.githubusercontent.com/u/10254612?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly-cmdx","html_url":"https://github.com/anatoly-cmdx","followers_url":"https://api.github.com/users/anatoly-cmdx/followers","following_url":"https://api.github.com/users/anatoly-cmdx/following{/other_user}","gists_url":"https://api.github.com/users/anatoly-cmdx/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly-cmdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly-cmdx/subscriptions","organizations_url":"https://api.github.com/users/anatoly-cmdx/orgs","repos_url":"https://api.github.com/users/anatoly-cmdx/repos","events_url":"https://api.github.com/users/anatoly-cmdx/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly-cmdx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anatoly-cmdx/stackoverflow","description":"","fork":false,"url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow","forks_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/forks","keys_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/teams","hooks_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/hooks","issue_events_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/events{/number}","events_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/events","assignees_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/assignees{/user}","branches_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/branches{/branch}","tags_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/tags","blobs_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/statuses/{sha}","languages_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/languages","stargazers_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/stargazers","contributors_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/contributors","subscribers_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/subscribers","subscription_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/subscription","commits_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/comments{/number}","contents_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/contents/{+path}","compare_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/merges","archive_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/downloads","issues_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues{/number}","pulls_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls{/number}","milestones_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/milestones{/number}","notifications_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/labels{/name}","releases_url":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/releases{/id}","created_at":"2015-03-10T17:14:43Z","updated_at":"2015-03-10T17:15:57Z","pushed_at":"2015-03-10T19:16:34Z","git_url":"git://github.com/anatoly-cmdx/stackoverflow.git","ssh_url":"git@github.com:anatoly-cmdx/stackoverflow.git","clone_url":"https://github.com/anatoly-cmdx/stackoverflow.git","svn_url":"https://github.com/anatoly-cmdx/stackoverflow","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":28,"forks":0,"open_issues":28,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28"},"html":{"href":"https://github.com/anatoly-cmdx/stackoverflow/pull/28"},"issue":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/28"},"comments":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/anatoly-cmdx/stackoverflow/statuses/f1b2ff164d7c8705dc4f88697dc143a2e710951d"}}}}