mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Improve logging
This commit is contained in:
parent
11fc484270
commit
bbbb3d5367
5 changed files with 8 additions and 17 deletions
|
@ -3,11 +3,13 @@ require 'test_helper'
|
|||
class InactiveContactsTest < ActiveSupport::TestCase
|
||||
def test_archives_inactive_contacts
|
||||
contact_mock = Minitest::Mock.new
|
||||
contact_mock.expect(:archive, nil)
|
||||
contact_mock.expect(:archive, nil, [{verified: false}])
|
||||
contact_mock.expect(:id, 'id')
|
||||
contact_mock.expect(:code, 'code')
|
||||
|
||||
inactive_contacts = InactiveContacts.new([contact_mock])
|
||||
inactive_contacts.archive
|
||||
|
||||
assert_mock contact_mock
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,8 @@ class ArchiveContactsTaskTest < ActiveSupport::TestCase
|
|||
contact = archivable_contact
|
||||
eliminate_effect_of_all_contacts_except(contact)
|
||||
|
||||
expected_output = "Contact ##{contact.id} (code: #{contact.code}) is archived\n" \
|
||||
expected_output = "Found archivable contact id(#{contact.id}), code (#{contact.code})\n" \
|
||||
"Archiving contact: id(#{contact.id}), code(#{contact.code})\n" \
|
||||
"Archived total: 1\n"
|
||||
assert_output(expected_output) { run_task }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue