Skip to content

Commit 1d2496c

Browse files
committed
ensures conversation factory will add its creator to participant list after it is created
1 parent b69a908 commit 1d2496c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/factories/better_together/conversations.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
aliases: %i[better_together_conversation conversation]) do
77
title { Faker::Lorem.sentence }
88
association :creator, factory: :person
9+
10+
after(:build) do |conversation|
11+
conversation.participants << conversation.creator
12+
end
913
end
1014
end

0 commit comments

Comments
 (0)