Skip to content

Commit 7fd88dc

Browse files
committed
Fixed CI tests for messages
1 parent 13cf07d commit 7fd88dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

BrainPortal/spec/models/message_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,19 @@
9999
expect do
100100
exception = Exception.new("error")
101101
allow(exception).to receive(:backtrace).and_return([""])
102-
allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).compact)
102+
allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).uniq.compact)
103103
Message.send_internal_error_message("","head", exception)
104-
end.to change { Message.count }.by(User.all_admins.map(&:own_group).compact.count)
104+
end.to change { Message.count }.by(User.all_admins.count)
105105
end
106106

107107
it "send a message to all users and admin (admin + normal user)" do
108108
users = [user]
109109
expect do
110110
exception = Exception.new("error")
111111
allow(exception).to receive(:backtrace).and_return([""])
112-
allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).compact)
112+
allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).uniq.compact)
113113
Message.send_internal_error_message(users,"head", exception)
114-
end.to change { Message.count }.by(User.all_admins.map(&:own_group).compact.count + users.size)
114+
end.to change { Message.count }.by(User.all_admins.count + users.size)
115115
end
116116

117117
end

0 commit comments

Comments
 (0)