mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:53:41 +08:00
Fabricate records with the right attributes during fabrication.
This commit is contained in:
parent
911f898a23
commit
77eb93ffb7
|
@ -424,18 +424,15 @@ describe UserNotifications do
|
|||
end
|
||||
|
||||
it "includes a list of participants, groups first with member lists" do
|
||||
group1 = Fabricate(:group)
|
||||
group2 = Fabricate(:group)
|
||||
group1.name = "group1"
|
||||
group2.name = "group2"
|
||||
user1 = Fabricate(:user)
|
||||
user2 = Fabricate(:user)
|
||||
user1.username = "one"
|
||||
user2.username = "two"
|
||||
user1.groups = [ group1, group2 ]
|
||||
user2.groups = [ group1 ]
|
||||
topic.allowed_users = [ user1, user2 ]
|
||||
topic.allowed_groups = [ group1, group2 ]
|
||||
group1 = Fabricate(:group, name: "group1")
|
||||
group2 = Fabricate(:group, name: "group2")
|
||||
|
||||
user1 = Fabricate(:user, username: "one", groups: [group1, group2])
|
||||
user2 = Fabricate(:user, username: "two", groups: [group1])
|
||||
|
||||
topic.allowed_users = [user1, user2]
|
||||
topic.allowed_groups = [group1, group2]
|
||||
|
||||
mail = UserNotifications.user_private_message(
|
||||
response.user,
|
||||
post: response,
|
||||
|
|
Loading…
Reference in New Issue
Block a user