A platform for community discussion. Free, open, simple.
DEV: Resolve flaky trust_level spec (#31165)
David Taylor2ceb40ffa455
diff --git a/spec/models/group_user_spec.rb b/spec/models/group_user_spec.rbindex ad960f77ed8..fcd6975a138 100644--- a/spec/models/group_user_spec.rb+++ b/spec/models/group_user_spec.rb@@ -298,15 +298,21 @@ RSpec.describe GroupUser dogroup_user = Fabricate(:group_user, group: group, user: user)expect(user.reload.trust_level).to eq(4)- expect(user.groups.where(automatic: true).map(&:name)).to eq(- %w[trust_level_0 trust_level_1 trust_level_2 trust_level_3 trust_level_4],+ expect(user.groups.where(automatic: true).map(&:name)).to contain_exactly(+ "trust_level_0",+ "trust_level_1",+ "trust_level_2",+ "trust_level_3",+ "trust_level_4",)group_user.destroy!# keep in mind that we do not restore tl3, cause reqs can be lostexpect(user.reload.trust_level).to eq(2)- expect(user.groups.where(automatic: true).map(&:name)).to eq(- %w[trust_level_0 trust_level_1 trust_level_2],+ expect(user.groups.where(automatic: true).map(&:name)).to contain_exactly(+ "trust_level_0",+ "trust_level_1",+ "trust_level_2",)end