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:
@@ -24,10 +24,9 @@ describe ProposalNotification do
|
||||
|
||||
describe "public_for_api scope" do
|
||||
it "returns proposal notifications" do
|
||||
proposal = create(:proposal)
|
||||
notification = create(:proposal_notification, proposal: proposal)
|
||||
notification = create(:proposal_notification, proposal: create(:proposal))
|
||||
|
||||
expect(ProposalNotification.public_for_api).to include(notification)
|
||||
expect(ProposalNotification.public_for_api).to eq [notification]
|
||||
end
|
||||
|
||||
it "blocks proposal notifications whose proposal is hidden" do
|
||||
|
||||
Reference in New Issue
Block a user