Skip to content

Instantly share code, notes, and snippets.

@domagude
Last active November 13, 2017 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domagude/997164b4e2988b151ab34f41e339d35f to your computer and use it in GitHub Desktop.
Save domagude/997164b4e2988b151ab34f41e339d35f to your computer and use it in GitHub Desktop.
FactoryGirl.define do
factory :private_conversation, class: 'Private::Conversation' do
association :recipient, factory: :user
association :sender, factory: :user
factory :private_conversation_with_messages do
transient do
messages_count 1
end
after(:create) do |private_conversation, evaluator|
create_list(:private_message, evaluator.messages_count,
conversation: private_conversation)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment