Check exact array contents instead of inclusion
We're using `eq` and `match_array` in most places, but there were a few places where we were still checking each element is included in the array. This is a bit dangerous, because the array could have duplicate elements, and we wouldn't detect them with `include`.
This commit is contained in:
@@ -14,7 +14,7 @@ describe EmailDigest do
|
||||
|
||||
email_digest = EmailDigest.new(user1)
|
||||
|
||||
expect(email_digest.notifications).to include(notification1)
|
||||
expect(email_digest.notifications).to eq [notification1]
|
||||
expect(email_digest.notifications).not_to include(notification2)
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ describe EmailDigest do
|
||||
|
||||
email_digest = EmailDigest.new(user)
|
||||
|
||||
expect(email_digest.notifications).to include(notification1)
|
||||
expect(email_digest.notifications).to eq [notification1]
|
||||
expect(email_digest.notifications).not_to include(notification2)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user