diff --git a/app/models/procedure.rb b/app/models/procedure.rb index c8dd7b625..d8f287ab1 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -304,15 +304,15 @@ class Procedure < ApplicationRecord end end - def mean_traitement_time + def usual_traitement_time mean_time(:en_construction_at, :processed_at) end - def mean_verification_time + def usual_verification_time mean_time(:en_construction_at, :en_instruction_at) end - def mean_instruction_time + def usual_instruction_time mean_time(:en_instruction_at, :processed_at) end diff --git a/app/views/new_user/dossiers/show/_status_overview.html.haml b/app/views/new_user/dossiers/show/_status_overview.html.haml index 167883f63..39f06f614 100644 --- a/app/views/new_user/dossiers/show/_status_overview.html.haml +++ b/app/views/new_user/dossiers/show/_status_overview.html.haml @@ -31,10 +31,10 @@ %strong votre dossier passera directement en instruction / FIXME: remove the custom procedure switch at some point - - if dossier.procedure.mean_verification_time && show_time_means + - if dossier.procedure.usual_verification_time && show_time_means - cache(dossier.procedure, expires_in: 1.week) do %p - Le temps moyen de vérification pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.mean_verification_time)}. + Le temps moyen de vérification pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.usual_verification_time)}. - elsif dossier.en_instruction? .en-instruction @@ -46,10 +46,10 @@ avec le résultat. / FIXME: remove the custom procedure switch at some point - - if dossier.procedure.mean_instruction_time && show_time_means + - if dossier.procedure.usual_instruction_time && show_time_means - cache(dossier.procedure, expires_in: 1.week) do %p - Le temps moyen d’instruction pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.mean_instruction_time)}. + Le temps moyen d’instruction pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.usual_instruction_time)}. - elsif dossier.accepte? .accepte diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 1f039cea0..a96599042 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -705,7 +705,7 @@ describe Procedure do end end - describe '#mean_instruction_time' do + describe '#usual_instruction_time' do let(:procedure) { create(:procedure) } context 'when there is only one dossier' do @@ -719,7 +719,7 @@ describe Procedure do dossier.update(en_instruction_at: instruction_date, processed_at: processed_date) end - it { expect(procedure.mean_instruction_time).to eq(1.day.to_i) } + it { expect(procedure.usual_instruction_time).to eq(1.day.to_i) } end end end