From 8839ac7f764cf8f26a5473c8883e782ede24140f Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 4 Apr 2023 10:32:36 +0200 Subject: [PATCH] fix(instructeur): pending_correction flag does not make messagerie unseen --- app/controllers/instructeurs/dossiers_controller.rb | 2 +- spec/controllers/instructeurs/dossiers_controller_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/instructeurs/dossiers_controller.rb b/app/controllers/instructeurs/dossiers_controller.rb index c82e3c0c3..219b350aa 100644 --- a/app/controllers/instructeurs/dossiers_controller.rb +++ b/app/controllers/instructeurs/dossiers_controller.rb @@ -13,7 +13,7 @@ module Instructeurs before_action :redirect_on_dossier_in_batch_operation, only: [:archive, :unarchive, :follow, :unfollow, :passer_en_instruction, :repasser_en_construction, :repasser_en_instruction, :terminer, :restore, :destroy, :extend_conservation] after_action :mark_demande_as_read, only: :show - after_action :mark_messagerie_as_read, only: [:messagerie, :create_commentaire] + after_action :mark_messagerie_as_read, only: [:messagerie, :create_commentaire, :pending_corrections] after_action :mark_avis_as_read, only: [:avis, :create_avis] after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations] diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index 74eb24daa..13f3be510 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -512,6 +512,8 @@ describe Instructeurs::DossiersController, type: :controller do allow(DossierMailer).to receive(:notify_pending_correction) .and_return(double(deliver_later: nil)) + + expect(controller.current_instructeur).to receive(:mark_tab_as_seen).with(dossier, :messagerie) end context "dossier en instruction" do