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:
Javi Martín
2019-09-26 19:54:26 +02:00
parent 9f0088396e
commit fd1325768f
21 changed files with 71 additions and 97 deletions

View File

@@ -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