Delete Units respecting foreign key constraint

This commit is contained in:
2025-01-16 20:46:22 +01:00
parent 7962cdf169
commit 5fff9adf4d
4 changed files with 4 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ class UnitsTest < ApplicationSystemTestCase
end
# Cannot #destroy_all due to {dependent: :restrict*} on Unit.subunits association
@user.units.delete_all
@user.units.order(Unit.arel_table[:base_id].eq(nil)).delete_all
visit units_path
within 'tbody' do
assert_selector 'tr', count: 1