FIX: Fix failing test.

FIX: Fix failing test.

diff --git a/spec/models/site_spec.rb b/spec/models/site_spec.rb
index 5576a48..6c89dca 100644
--- a/spec/models/site_spec.rb
+++ b/spec/models/site_spec.rb
@@ -74,7 +74,7 @@ describe Site do
     expect(site.groups.pluck(:name)).to eq(["moderators"])
 
     group = Fabricate(:group)
-    expect(site.groups.pluck(:name)).to eq([group.name])
+    expect(site.groups.pluck(:name)).to eq(["moderators", group.name])
 
     admin = Fabricate(:admin)
     site = Site.new(Guardian.new(admin))

GitHub sha: 7003ea96

When order is not relevant, it’s much better to use contain_exactly

expect(site.groups.pluck(:name)).to contain_exactly("moderators", group.name)

Order is technically relevant here the thing explicitly orders by name. That said I did follow up a bit here I could have checked that we have all the groups (tl0,1 etc…) but decided to skip and just check for strategic stuff cause long term the test is less fragile like that.

1 Like