Fix false positive

I found out while trying to make another test fail.
If the `new_memberships` array was empty (i.e none of the user memberships were found) it had nothing to iterate over, so it returned true.
Hopefully, only one test seems to be affected by this.
This commit is contained in:
Jan Cernik 2023-02-07 23:01:58 -03:00
parent 60694e828c
commit 3c9444c47e
No known key found for this signature in database

View File

@ -201,6 +201,7 @@ describe Jobs::AutoJoinChannelBatch do
def assert_users_follows_channel(channel, users)
new_memberships = UserChatChannelMembership.where(user: users, chat_channel: channel)
expect(new_memberships.length).to eq(users.length)
expect(new_memberships.all?(&:following)).to eq(true)
end