{"action":"created","issue":{"url":"https://api.github.com/repos/merch2/app/issues/8","labels_url":"https://api.github.com/repos/merch2/app/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/merch2/app/issues/8/comments","events_url":"https://api.github.com/repos/merch2/app/issues/8/events","html_url":"https://github.com/merch2/app/pull/8","id":64455014,"number":8,"title":"lesson8.1","user":{"login":"merch2","id":11390019,"avatar_url":"https://avatars.githubusercontent.com/u/11390019?v=3","gravatar_id":"","url":"https://api.github.com/users/merch2","html_url":"https://github.com/merch2","followers_url":"https://api.github.com/users/merch2/followers","following_url":"https://api.github.com/users/merch2/following{/other_user}","gists_url":"https://api.github.com/users/merch2/gists{/gist_id}","starred_url":"https://api.github.com/users/merch2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merch2/subscriptions","organizations_url":"https://api.github.com/users/merch2/orgs","repos_url":"https://api.github.com/users/merch2/repos","events_url":"https://api.github.com/users/merch2/events{/privacy}","received_events_url":"https://api.github.com/users/merch2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"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,"comments":3,"created_at":"2015-03-26T07:08:11Z","updated_at":"2015-03-29T09:57:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/merch2/app/pulls/8","html_url":"https://github.com/merch2/app/pull/8","diff_url":"https://github.com/merch2/app/pull/8.diff","patch_url":"https://github.com/merch2/app/pull/8.patch"},"body":"сделал добавление файлов для вопроса и ответа. возможность добавления больше 1 файла через нестед форм."},"comment":{"url":"https://api.github.com/repos/merch2/app/issues/comments/87383579","html_url":"https://github.com/merch2/app/pull/8#issuecomment-87383579","issue_url":"https://api.github.com/repos/merch2/app/issues/8","id":87383579,"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},"created_at":"2015-03-29T09:57:25Z","updated_at":"2015-03-29T09:57:25Z","body":"Во-первых, в фабрике attachment нужно [добавить файл](https://github.com/carrierwaveuploader/carrierwave/wiki/How-to:-Use-test-factories#factorygirl).\r\n\r\nВо-вторых, добавить в фабрику вопроса/ответа либо trait `:with_files`, либо transition свойство, либо и то, и другое, для создания вопроса/ответа с файлами:\r\n\r\n```ruby\r\nFactoryGirl.define(:question) do\r\n  ...\r\n  trait :with_files\r\n    transient do\r\n      number_of_files 1\r\n    end\r\n\r\n    after(:create) do |question, evaluator|\r\n      create_list(:attachment, evaluator.number_of_files, attachable: question)\r\n    end\r\n  end\r\nend \r\n\r\n# и далее в коде теста\r\ncreate(:question, :with_files, number_of_files: 2)\r\n```\r\n"}}