fix(spec): broken spec due to TDD and refacto on former code

This commit is contained in:
Martin 2022-07-21 20:05:05 +02:00 committed by mfo
parent 711b2ee2e4
commit dc524cf615
7 changed files with 8 additions and 9 deletions

View file

@ -15,7 +15,7 @@ class Administrateur < ApplicationRecord
UNUSED_ADMIN_THRESHOLD = 6.months
has_and_belongs_to_many :instructeurs
has_many :administrateurs_procedures, dependent: :destroy
has_many :administrateurs_procedures
has_many :procedures, through: :administrateurs_procedures
has_many :services
@ -103,7 +103,7 @@ class Administrateur < ApplicationRecord
# We can't destroy a service if it has procedures, even if those procedures are archived
service.destroy unless service.procedures.with_discarded.any?
end
AdministrateursProcedure.where(administrateur_id: self.id).delete_all
destroy
end