Skip to content

Commit

Permalink
Fixed CI tests for messages
Browse files Browse the repository at this point in the history
  • Loading branch information
prioux committed Jul 21, 2024
1 parent 13cf07d commit 7fd88dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BrainPortal/spec/models/message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@
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
users = [user]
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
Expand Down

0 comments on commit 7fd88dc

Please sign in to comment.