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:
@@ -30,7 +30,7 @@ describe Poll::Booth do
|
||||
booth_for_current_poll = create(:poll_booth, polls: [create(:poll, :current)])
|
||||
booth_for_expired_poll = create(:poll_booth, polls: [create(:poll, :expired)])
|
||||
|
||||
expect(Poll::Booth.available).to include(booth_for_current_poll)
|
||||
expect(Poll::Booth.available).to eq [booth_for_current_poll]
|
||||
expect(Poll::Booth.available).not_to include(booth_for_expired_poll)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user