Fix contact archivation tests

This commit is contained in:
Karl Erik Õunapuu 2020-09-03 10:46:05 +03:00
parent 3c7756680d
commit 7a24eab63a
No known key found for this signature in database
GPG key ID: C9DD647298A34764
2 changed files with 2 additions and 3 deletions

View file

@ -265,9 +265,8 @@ class ContactTest < ActiveSupport::TestCase
def test_unlinked_scope_skips_contact_that_is_linked_as_registrant
contact = unlinked_contact
domains(:shop).update_columns(registrant_id: contact.becomes(Registrant))
domains(:shop).update_columns(registrant_id: contact.becomes(Registrant).id)
reload
assert Contact.unlinked.exclude?(contact), 'Contact should be excluded'
end

View file

@ -36,7 +36,7 @@ class ArchiveContactsTaskTest < ActiveSupport::TestCase
def eliminate_effect_of_all_contacts_except(contact)
Contact.connection.disable_referential_integrity do
Contact.delete_all("id != #{contact.id}")
Contact.where("id != #{contact.id}").delete_all
end
end