From 7fd88dc85646b8ddd51cdc637de7891f2c7a1f5e Mon Sep 17 00:00:00 2001 From: Pierre Rioux Date: Sun, 21 Jul 2024 11:12:57 -0400 Subject: [PATCH] Fixed CI tests for messages --- BrainPortal/spec/models/message_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BrainPortal/spec/models/message_spec.rb b/BrainPortal/spec/models/message_spec.rb index 56069f523..2c352b7fc 100644 --- a/BrainPortal/spec/models/message_spec.rb +++ b/BrainPortal/spec/models/message_spec.rb @@ -99,9 +99,9 @@ expect do exception = Exception.new("error") allow(exception).to receive(:backtrace).and_return([""]) - allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).compact) + allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).uniq.compact) Message.send_internal_error_message("","head", exception) - end.to change { Message.count }.by(User.all_admins.map(&:own_group).compact.count) + end.to change { Message.count }.by(User.all_admins.count) end it "send a message to all users and admin (admin + normal user)" do @@ -109,9 +109,9 @@ expect do exception = Exception.new("error") allow(exception).to receive(:backtrace).and_return([""]) - allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).compact) + allow(WorkGroup).to receive(:find_by_id).and_return(User.all_admins.map(&:own_group).uniq.compact) Message.send_internal_error_message(users,"head", exception) - end.to change { Message.count }.by(User.all_admins.map(&:own_group).compact.count + users.size) + end.to change { Message.count }.by(User.all_admins.count + users.size) end end