mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Fix contact archivation tests
This commit is contained in:
parent
3c7756680d
commit
7a24eab63a
2 changed files with 2 additions and 3 deletions
|
@ -265,9 +265,8 @@ class ContactTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def test_unlinked_scope_skips_contact_that_is_linked_as_registrant
|
def test_unlinked_scope_skips_contact_that_is_linked_as_registrant
|
||||||
contact = unlinked_contact
|
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'
|
assert Contact.unlinked.exclude?(contact), 'Contact should be excluded'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ArchiveContactsTaskTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def eliminate_effect_of_all_contacts_except(contact)
|
def eliminate_effect_of_all_contacts_except(contact)
|
||||||
Contact.connection.disable_referential_integrity do
|
Contact.connection.disable_referential_integrity do
|
||||||
Contact.delete_all("id != #{contact.id}")
|
Contact.where("id != #{contact.id}").delete_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue