mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 06:56:23 +02:00
Improve check force delete query
This commit is contained in:
parent
ee76deaf52
commit
27fbf224f9
2 changed files with 23 additions and 25 deletions
|
@ -38,6 +38,25 @@ class CheckForceDeleteTaskTest < ActiveSupport::TestCase
|
|||
assert_enqueued_with(job: CheckForceDeleteJob, args: [[@invalid_contact.id]])
|
||||
end
|
||||
|
||||
def test_not_enque_force_delete
|
||||
trumail_results = OpenStruct.new(success: false,
|
||||
email: @contact.email,
|
||||
domain: 'box.tests',
|
||||
errors: { mx: 'target host(s) not found' })
|
||||
|
||||
Spy.on_instance_method(Actions::EmailCheck, :check_email).and_return(trumail_results)
|
||||
Spy.on_instance_method(Actions::AAndAaaaEmailValidation, :call).and_return([])
|
||||
|
||||
action = Actions::EmailCheck.new(email: @contact.email,
|
||||
validation_eventable: @contact,
|
||||
check_level: 'mx')
|
||||
2.times do
|
||||
action.call
|
||||
end
|
||||
|
||||
assert_enqueued_jobs 0
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def run_task
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue