{"action":"opened","issue":{"url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/789","labels_url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/789/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/789/comments","events_url":"https://api.github.com/repos/thoughtbot/factory_girl/issues/789/events","html_url":"https://github.com/thoughtbot/factory_girl/issues/789","id":86878365,"number":789,"title":"Problems factory_girl faker data in has_many associations","user":{"login":"VoTaiTri","id":10524856,"avatar_url":"https://avatars.githubusercontent.com/u/10524856?v=3","gravatar_id":"","url":"https://api.github.com/users/VoTaiTri","html_url":"https://github.com/VoTaiTri","followers_url":"https://api.github.com/users/VoTaiTri/followers","following_url":"https://api.github.com/users/VoTaiTri/following{/other_user}","gists_url":"https://api.github.com/users/VoTaiTri/gists{/gist_id}","starred_url":"https://api.github.com/users/VoTaiTri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoTaiTri/subscriptions","organizations_url":"https://api.github.com/users/VoTaiTri/orgs","repos_url":"https://api.github.com/users/VoTaiTri/repos","events_url":"https://api.github.com/users/VoTaiTri/events{/privacy}","received_events_url":"https://api.github.com/users/VoTaiTri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-10T07:49:08Z","updated_at":"2015-06-10T07:49:08Z","closed_at":null,"body":"I'm new rspec test and factory_girl, help me that problem, please!\r\nI have 3 models User, Review and Activity look like\r\n```ruby\r\nclass User < ActiveRecord::Base\r\n  has_many :reviews, dependent: :destroy\r\n  has_many :activities, dependent: :destroy\r\nend\r\n\r\nclass Review < ActiveRecord::Base\r\n  belongs_to :user\r\nend\r\n\r\nclass Activity < ActiveRecord::Base\r\n  belongs_to :user\r\n  \r\n  validates :target_id, presence: true\r\n  validates :action_type, presence: true\r\n```\r\nmodel Activity to save activity of each user. In this case, activity is reviewing. Whenever user create a new record in reviews table, the system also creates a record in activities table (target_id = review_id , action_type = \"review\")\r\nNow, when i write rspec test for User model, i need test for association User has_many Activity. So how can i faker data of model User, Review and Activity by factory_girl to do that???"}}