Simplify testing arrays exact contents

Instead of testing the contents of each element, we can test the whole
array at once.
This commit is contained in:
Javi Martín
2019-09-26 17:30:38 +02:00
parent 24f14ea772
commit a04a289850
10 changed files with 44 additions and 114 deletions

View File

@@ -218,8 +218,7 @@ describe UserSegments do
create(:user, email: "last@email.com")
emails = UserSegments.user_segment_emails(:all_users)
expect(emails.first).to eq "first@email.com"
expect(emails.last).to eq "last@email.com"
expect(emails).to eq ["first@email.com", "last@email.com"]
end
end