Use enum to the fullest with Dossier.states

This commit is contained in:
gregoirenovel 2018-08-28 14:10:55 +02:00
parent ee25bba38c
commit 4b071ecf06
52 changed files with 221 additions and 221 deletions

View file

@ -162,7 +162,7 @@ describe StatsController, type: :controller do
:processed_at => 2.months.ago.beginning_of_month + 4.days)
# Write directly in the DB to avoid the before_validation hook
Dossier.update_all(state: "accepte")
Dossier.update_all(state: Dossier.states.fetch(:accepte))
@expected_hash = {
"#{2.months.ago.beginning_of_month}" => 3.0,
@ -170,7 +170,7 @@ describe StatsController, type: :controller do
}
end
let (:association) { Dossier.where.not(:state => :brouillon) }
let (:association) { Dossier.where.not(:state => Dossier.states.fetch(:brouillon)) }
subject { StatsController.new.send(:dossier_instruction_mean_time, association) }
@ -214,7 +214,7 @@ describe StatsController, type: :controller do
:processed_at => 2.months.ago.beginning_of_month + 1.day)
# Write directly in the DB to avoid the before_validation hook
Dossier.update_all(state: "accepte")
Dossier.update_all(state: Dossier.states.fetch(:accepte))
@expected_hash = {
"#{2.months.ago.beginning_of_month}" => 30.0,
@ -222,7 +222,7 @@ describe StatsController, type: :controller do
}
end
let (:association) { Dossier.where.not(:state => :brouillon) }
let (:association) { Dossier.where.not(:state => Dossier.states.fetch(:brouillon)) }
subject { StatsController.new.send(:dossier_filling_mean_time, association) }