feat(Commentaire.notify_user): wait 5 minutes before sending email to user when instructor write a commentaire. leaving some space for instructor to destroy his message

This commit is contained in:
Martin 2021-11-15 15:38:57 +01:00
parent f8783c9f00
commit c68fa2d7f3
4 changed files with 43 additions and 5 deletions

View file

@ -86,8 +86,8 @@ describe Commentaire do
context "with a commentaire created by a instructeur" do
let(:commentaire) { CommentaireService.build(instructeur, dossier, body: "Mon commentaire") }
it "calls notify_user" do
expect(commentaire).to receive(:notify_user)
it "calls notify_user with delay so instructeur can destroy his comment in case of failure" do
expect(commentaire).to receive(:notify_user_with_delay)
commentaire.save
end
end