Skip to content

Commit

Permalink
Fix contact archivation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karlerikounapuu committed Sep 3, 2020
1 parent 3c77566 commit 7a24eab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/models/contact_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ def test_unlinked_scope_returns_unlinked_contact

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

Expand Down
2 changes: 1 addition & 1 deletion test/tasks/contacts/archive_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def archivable_contact

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

Expand Down

0 comments on commit 7a24eab

Please sign in to comment.