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:
@@ -31,8 +31,7 @@ describe Widget::Card do
|
||||
card2 = create(:widget_card, header: false)
|
||||
page_card = create(:widget_card, header: false, page: create(:site_customization_page))
|
||||
|
||||
expect(Widget::Card.body).to include(card1)
|
||||
expect(Widget::Card.body).to include(card2)
|
||||
expect(Widget::Card.body).to match_array [card1, card2]
|
||||
expect(Widget::Card.body).not_to include(header)
|
||||
expect(Widget::Card.body).not_to include(page_card)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user