mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 15:06:23 +02:00
move validator from callback to action interactor and to the api controller
This commit is contained in:
parent
f4d276fc44
commit
8eee65579b
9 changed files with 127 additions and 116 deletions
|
@ -29,25 +29,23 @@ class ValidationEventTest < ActiveSupport::TestCase
|
|||
assert contact.need_to_start_force_delete?
|
||||
end
|
||||
|
||||
def test_fd_didnt_set_if_mx_interation_less_then_value
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
|
||||
email = 'email@somestrangedomain12345.ee'
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD - 4).times do
|
||||
contact.verify_email(check_level: 'mx')
|
||||
end
|
||||
contact.reload
|
||||
|
||||
# def test_fd_didnt_set_if_mx_interation_less_then_value
|
||||
# @domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
# assert_not @domain.force_delete_scheduled?
|
||||
# travel_to Time.zone.parse('2010-07-05')
|
||||
|
||||
# email = 'email@somestrangedomain12345.ee'
|
||||
# contact = @domain.admin_contacts.first
|
||||
# contact.update_attribute(:email, email)
|
||||
# (ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD - 4).times do
|
||||
# contact.verify_email(check_level: 'mx')
|
||||
# end
|
||||
# contact.reload
|
||||
|
||||
# refute contact.validation_events.limit(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD)
|
||||
# .any?(&:success?)
|
||||
# assert_not contact.need_to_start_force_delete?
|
||||
# end
|
||||
refute contact.validation_events.limit(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD)
|
||||
.any?(&:success?)
|
||||
assert_not contact.need_to_start_force_delete?
|
||||
end
|
||||
|
||||
def test_if_fd_need_to_be_set_if_invalid_mx
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue