From d2f3bb18f940ee5d12d471eb146e5ed41b8186a4 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 23 Nov 2020 17:29:41 +0100 Subject: [PATCH] instructeur can delete a dossier UI --- app/controllers/users/dossiers_controller.rb | 2 +- spec/controllers/instructeurs/dossiers_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 5cd6732b1..4186cca5e 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -276,7 +276,7 @@ module Users private def statut - @statut = params[:statut].blank? ? 'mes-dossiers' : params[:statut] + @statut = params[:statut].presence || 'mes-dossiers' end def store_user_location! diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index 844a8d40e..c396f0347 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -751,7 +751,7 @@ describe Instructeurs::DossiersController, type: :controller do end it 'send an email to the user' do - expect(DossierMailer).to have_received(:notify_instructeur_deletion_to_user).with(DeletedDossier.find(dossier.id), dossier.user.email) + expect(DossierMailer).to have_received(:notify_instructeur_deletion_to_user).with(DeletedDossier.where(dossier_id: dossier.id).first, dossier.user.email) end it 'add a record into deleted_dossiers table' do