Use enum to the fullest with Dossier.states
This commit is contained in:
parent
ee25bba38c
commit
4b071ecf06
52 changed files with 221 additions and 221 deletions
|
@ -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) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue