FIX: Don't try to send invite email when invite was deleted

This commit is contained in:
Gerhard Schlager
2018-08-29 12:02:47 +02:00
parent bf9b7f1f25
commit b2cf725700
2 changed files with 7 additions and 0 deletions

View File

@@ -20,6 +20,11 @@ describe Jobs::InviteEmail do
Jobs::InviteEmail.new.execute(invite_id: invite.id)
end
it "aborts without error when the invite doesn't exist anymore" do
invite.destroy
InviteMailer.expects(:send_invite).never
Jobs::InviteEmail.new.execute(invite_id: invite.id)
end
end
end