This commit is contained in:
Kara Diaby 2022-03-17 11:21:45 +01:00
parent eda5f75ec3
commit 4bfcf4f9d9

View file

@ -457,6 +457,20 @@ describe Instructeurs::DossiersController, type: :controller do
expect(flash.notice).to be_present expect(flash.notice).to be_present
end end
end end
context "when the dossier is deleted by user" do
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
before do
dossier.update!(hidden_by_user_at: 1.hour.ago)
subject
end
it "does not create a commentaire" do
expect { subject }.to change(Commentaire, :count).by(0)
expect(flash.alert).to be_present
end
end
end end
describe "#create_avis" do describe "#create_avis" do