Prefer using match_array over eq to compare array

As we don't need order: https://rubydoc.info/github/rspec/rspec-expectations/RSpec%2FMatchers:match_array
This commit is contained in:
Jean-Baptiste Bellet
2023-05-25 14:52:31 +02:00
parent 8dde81c498
commit cf9342f2c4

View File

@@ -91,7 +91,7 @@ module Api
q: { with_properties: [supplier_property.id] }
expect(response.status).to eq 200
expect(product_ids).to eq [product1.id, product2.id]
expect(product_ids).to match_array [product1.id, product2.id]
expect(product_ids).to_not include product3.id
end
end