Sort each array to ensure the order

and then expect the right values.
This commit is contained in:
Jean-Baptiste Bellet
2023-03-13 16:07:46 +01:00
parent ecd5033efa
commit 8dffb38bf5

View File

@@ -288,8 +288,10 @@ describe OrderCycleForm do
distributor.users.first
)
expect{ form.save }.to change{ order_cycle.distributor_payment_methods.pluck(:id) }
.from([distributor_payment_method, distributor_payment_method2])
expect{ form.save }.to change{
order_cycle.distributor_payment_methods.pluck(:id).sort
}
.from([distributor_payment_method, distributor_payment_method2].sort)
.to([distributor_payment_method])
end
end