diff --git a/README.md b/README.md index 1da3805cd..9f426ef42 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ client_secret: '' AutoArchiveProcedureJob.set(cron: "* * * * *").perform_later WeeklyOverviewJob.set(cron: "0 8 * * 0").perform_later - AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(procedure_declaratoire_id, "received") + AutoReceiveDossiersForProcedureJob.set(cron: "* * * * *").perform_later(procedure_declaratoire_id, 'en_instruction') FindDubiousProceduresJob.set(cron: "0 0 * * *").perform_later ## Exécution des tests (RSpec) diff --git a/app/jobs/auto_receive_dossiers_for_procedure_job.rb b/app/jobs/auto_receive_dossiers_for_procedure_job.rb index ee04c9cbb..c615309f4 100644 --- a/app/jobs/auto_receive_dossiers_for_procedure_job.rb +++ b/app/jobs/auto_receive_dossiers_for_procedure_job.rb @@ -4,12 +4,12 @@ class AutoReceiveDossiersForProcedureJob < ApplicationJob def perform(procedure_id, state) procedure = Procedure.find(procedure_id) attrs = case state - when :en_instruction + when 'en_instruction' { state: :en_instruction, en_instruction_at: DateTime.now } - when :accepte + when 'accepte' { state: :accepte, en_instruction_at: DateTime.now, diff --git a/spec/jobs/auto_receive_dossiers_for_procedure_job_spec.rb b/spec/jobs/auto_receive_dossiers_for_procedure_job_spec.rb index a7a546b43..963fc84fe 100644 --- a/spec/jobs/auto_receive_dossiers_for_procedure_job_spec.rb +++ b/spec/jobs/auto_receive_dossiers_for_procedure_job_spec.rb @@ -17,7 +17,7 @@ RSpec.describe AutoReceiveDossiersForProcedureJob, type: :job do let(:procedure_id) { dossier_brouillon.procedure_id } context "en_construction" do - let(:state) { :en_instruction } + let(:state) { 'en_instruction' } it do subject @@ -36,7 +36,7 @@ RSpec.describe AutoReceiveDossiersForProcedureJob, type: :job do end context "accepte" do - let(:state) { :accepte } + let(:state) { 'accepte' } it do subject