Test poll notification is sent to registrar after contact archivation

This commit is contained in:
Karl Erik Õunapuu 2020-09-04 15:30:01 +03:00
parent a5b59f20ab
commit 5330743e51
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -58,6 +58,16 @@ class ArchivableContactTest < ActiveSupport::TestCase
assert_equal 'Contact cannot be archived', e.message
end
def test_sends_poll_msg_to_registrar_after_archivation
contact = archivable_contact
registrar = contact.registrar
contact.archive
assert_equal(I18n.t(:contact_has_been_archived, contact_code: contact.code,
orphan_months: Setting.orphans_contacts_in_months),
registrar.notifications.last.text)
end
private
def archivable_contact