DEV: Fix a flaky test (#19705)

We don't really care about the order here so there is no need for us to
assert against a fixed order.
This commit is contained in:
Alan Guo Xiang Tan 2023-01-04 09:21:21 +08:00 committed by GitHub
parent 6e0d4b2c1c
commit 81c3c746d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ RSpec.describe SiteSerializer do
SiteSetting.whispers_allowed_groups = "#{group1.id}|#{group2.id}"
serialized = described_class.new(Site.new(admin_guardian), scope: admin_guardian, root: false).as_json
expect(serialized[:whispers_allowed_groups_names]).to eq(["whisperers1", "whisperers2"])
expect(serialized[:whispers_allowed_groups_names]).to contain_exactly("whisperers1", "whisperers2")
end
it "returns correct group names for automatic groups" do
@ -263,7 +263,7 @@ RSpec.describe SiteSerializer do
SiteSetting.whispers_allowed_groups = "#{group1.id}|#{group2.id}"
serialized = described_class.new(Site.new(user_guardian), scope: user_guardian, root: false).as_json
expect(serialized[:whispers_allowed_groups_names]).to eq(["whisperers1", "whisperers2"])
expect(serialized[:whispers_allowed_groups_names]).to contain_exactly("whisperers1", "whisperers2")
end
it "returns nil when user is not allowed to whisper" do